Skip to content

Commit 392275f

Browse files
committed
CLI: cosmetic improvements
1 parent 61945bf commit 392275f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/cscs/Utils/CoreExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,15 @@ internal static string[] RetreiveProcessPathExtraDirs(this Process p)
467467
return dirs?.Split(';') ?? new string[0];
468468
}
469469

470-
internal static void AddToSystemPath(this string[] dirs)
470+
internal static void AddToSystemPath(this IEnumerable<string> dirs)
471471
{
472472
if (dirs.Any())
473473
{
474474
var newPathDirs = dirs
475475
.Where(x => x.HasText())
476+
#if !class_lib
477+
.Except(Settings.PseudoDirItems)
478+
#endif
476479
.Select(x => x);
477480

478481
var currentPath = Environment.GetEnvironmentVariable("PATH").Split(';').Where(x => x.HasText());

src/cscs/Utils/Utils.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,6 @@ static public bool IsOutOfDate(string script, string assembly)
17431743
depInfo.items
17441744
.Where(x => x.IsDir)
17451745
.Select(x => x.file.Substring("dir:".Length))
1746-
.ToArray()
17471746
.AddToSystemPath();
17481747

17491748
return false;

src/cscs/csscript.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,7 @@ void ExecuteImpl()
10121012
// add searchDirs to PATH to support search path for native dlls
10131013
// need to do this before compilation or execution
10141014

1015-
options.searchDirs.Except(Settings.PseudoDirItems).ToArray()
1016-
.AddToSystemPath();
1015+
options.searchDirs.AddToSystemPath();
10171016

10181017
// --- COMPILE ---
10191018
if (options.buildExecutable || !options.useCompiled || (options.useCompiled && assemblyFileName == null) || options.forceCompile)
@@ -1067,7 +1066,7 @@ void ExecuteImpl()
10671066

10681067
var pureCompilerTime = (compilationTime - initializationTime);
10691068

1070-
// May need the higher precision timing in teh future so keeping it
1069+
// May need the higher precision timing in the future so keeping it
10711070
// TimeSpan compilationOverheadTime = default;
10721071
// if (Profiler.has("compiler"))
10731072
// {
@@ -1153,7 +1152,7 @@ void ExecuteImpl()
11531152
}
11541153
}
11551154

1156-
options.searchDirs.AddToSystemPath();
1155+
options.searchDirs.Except(Settings.PseudoDirItems).AddToSystemPath();
11571156
// Process.GetCurrentProcess().RetreiveProcessPathExtraDirs().AddToSystemPath();
11581157

11591158
if (options.useCompiled)

0 commit comments

Comments
 (0)