Refactor courtesy WebFreak001.

Co-authored-by: Jan Jurzitza <gh@webfreak.org>
This commit is contained in:
Bastiaan Veelo 2022-05-27 19:20:57 +02:00 committed by Bastiaan Veelo
parent f6d9d04e43
commit b8da7c5cd4
1 changed files with 2 additions and 3 deletions

View File

@ -15,8 +15,7 @@ else
int main()
{
foreach (braceStyle; ["allman", "otbs", "knr"])
foreach (entry; dirEntries(".", "*.d", SpanMode.shallow).
filter!(e => e.baseName(".d") != thisExePath.baseName(".exe")))
foreach (entry; dirEntries(".", "*.d", SpanMode.shallow).filter!(e => e.baseName(".d") != "test"))
{
const source = entry.baseName;
const outFileName = buildPath(braceStyle, source ~ ".out");
@ -24,7 +23,7 @@ int main()
const argsFile = source.stripExtension ~ ".args";
const dfmtCommand =
[dfmt, "--brace_style=" ~ braceStyle] ~
(argsFile.exists ? readText(argsFile).splitter!isWhite.filter!(a => a.length).array : []) ~
(argsFile.exists ? readText(argsFile).split : []) ~
[source];
writeln(dfmtCommand.join(" "));
if (const result = spawnProcess(dfmtCommand, stdin, File(outFileName, "w")).wait)