Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Stop redirecting std output in csq
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Aug 20, 2022
1 parent 0e8cbea commit 6c782af
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Squirrel.Tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ static int RunCsqFromPath(string toolRootPath, string[] args)
var cliPath = Path.Combine(toolRootPath, "Squirrel.CommandLine.dll");
var dnargs = new[] { cliPath }.Concat(args).ToArray();
Write("running dotnet " + String.Join(" ", dnargs), true);
return PlatformUtil.InvokeProcess("dotnet", dnargs, Environment.CurrentDirectory, CancellationToken.None).ExitCode;
return RunProcess("dotnet", dnargs);
}

// v3.0 - v3.0.170
var toolDllPath = Path.Combine(toolRootPath, "csq.dll");
if (File.Exists(toolDllPath)) {
var dnargs = new[] { toolDllPath, "--csq-embedded" }.Concat(args).ToArray();
Write("running dotnet " + String.Join(" ", dnargs), true);
return PlatformUtil.InvokeProcess("dotnet", dnargs, Environment.CurrentDirectory, CancellationToken.None).ExitCode;
return RunProcess("dotnet", dnargs);
}

// < v3.0
Expand All @@ -189,12 +189,19 @@ static int RunCsqFromPath(string toolRootPath, string[] args)
throw new NotSupportedException(
$"Squirrel at '{toolRootPath}' does not support this operating system. Please update the package version to >= 3.0");
Write("running " + toolExePath + " " + String.Join(" ", args), true);
return PlatformUtil.InvokeProcess(toolExePath, args, Environment.CurrentDirectory, CancellationToken.None).ExitCode;
return RunProcess(toolExePath, args);
}

throw new Exception("Unable to locate Squirrel at: " + toolRootPath);
}

static int RunProcess(string path, string[] args)
{
var p = Process.Start(path, args);
p.WaitForExit();
return p.ExitCode;
}

static IEnumerable<string> GetPackageVersionsFromDir(string rootDir, string packageName)
{
// old-style framework packages.config
Expand Down

0 comments on commit 6c782af

Please sign in to comment.