Skip to content

Commit

Permalink
Fixed verb handling in Go
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelMayer committed Sep 2, 2022
1 parent 440f0a5 commit c0cfb9e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/Dafny/Compilers/Compiler-go.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3568,9 +3568,9 @@ private bool SendToNewGoProcess(string dafnyProgramName, string targetFilename,
}
}

string verb;
List<string> verb = new();
if (run) {
verb = "run";
verb.Add("run");
} else {
string output;
var outputToFile = !DafnyOptions.O.RunAfterCompile;
Expand Down Expand Up @@ -3605,7 +3605,9 @@ private bool SendToNewGoProcess(string dafnyProgramName, string targetFilename,
}
}

verb = string.Format("build -o \"{0}\"", output);
verb.Add("build");
verb.Add("-o");
verb.Add(output);
}

var psi = new ProcessStartInfo("go") {
Expand All @@ -3615,7 +3617,9 @@ private bool SendToNewGoProcess(string dafnyProgramName, string targetFilename,
RedirectStandardOutput = false,
RedirectStandardError = false,
};
psi.ArgumentList.Add(verb);
foreach (var verbArg in verb) {
psi.ArgumentList.Add(verbArg);
}
psi.ArgumentList.Add(targetFilename);
foreach (var arg in DafnyOptions.O.MainArgs) {
psi.ArgumentList.Add(arg);
Expand Down

0 comments on commit c0cfb9e

Please sign in to comment.