From 497a900f210a0a0831110f60162922adc5fc5283 Mon Sep 17 00:00:00 2001 From: H Paterson <26947190+patha454@users.noreply.github.com> Date: Sat, 21 Mar 2020 18:52:00 +1300 Subject: [PATCH] Exclude all hidden directories. --- src/dscanner/utils.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dscanner/utils.d b/src/dscanner/utils.d index d5b1d29..e5938c1 100644 --- a/src/dscanner/utils.d +++ b/src/dscanner/utils.d @@ -4,6 +4,7 @@ import std.array : appender, uninitializedArray; import std.stdio : stdin, stderr, File; import std.conv : to; import std.encoding : BOM, BOMSeq, EncodingException, getBOM; +import std.path : dirSeparator; import std.format : format; import std.file : exists, read; @@ -105,7 +106,7 @@ string[] expandArgs(string[] args) else foreach (item; dirEntries(arg, SpanMode.breadth).map!(a => a.name)) { - if (isFileSafe(item) && (item.endsWith(`.d`) || item.endsWith(`.di`)) && !item.find('.git')) + if (isFileSafe(item) && (item.endsWith(`.d`) || item.endsWith(`.di`)) && !item.find(dirSeparator ~ '.')) rVal ~= item; else continue;