-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
47 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
|
||
namespace Paket.Bootstrapper | ||
{ | ||
class ConsoleRunner | ||
{ | ||
static readonly Version VersionWithFromBootstrapper = new Version("3.23.2"); | ||
|
||
static IEnumerable<string> SetBootstrapperArgument(string program, IEnumerable<string> arguments) | ||
{ | ||
var versionInfo = FileVersionInfo.GetVersionInfo(program); | ||
var version = new Version(versionInfo.FileVersion); | ||
return version >= VersionWithFromBootstrapper | ||
? new[] {"--from-bootstrapper"}.Concat(arguments) | ||
: arguments; | ||
} | ||
|
||
public static int Run(string program, IEnumerable<string> arguments) | ||
{ | ||
arguments = SetBootstrapperArgument(program, arguments); | ||
var argString = WindowsProcessArguments.ToString(arguments); | ||
var process = new Process | ||
{ | ||
StartInfo = | ||
{ | ||
FileName = program, | ||
Arguments = argString, | ||
UseShellExecute = false | ||
} | ||
}; | ||
process.Start(); | ||
process.WaitForExit(); | ||
return process.ExitCode; | ||
} | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
src/Paket.Bootstrapper/ConsoleRunnerStrategies/ConsoleRunner.cs
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/Paket.Bootstrapper/ConsoleRunnerStrategies/IConsoleRunner.cs
This file was deleted.
Oops, something went wrong.
164 changes: 0 additions & 164 deletions
164
src/Paket.Bootstrapper/ConsoleRunnerStrategies/UnixMonoConsoleRunner.cs
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
src/Paket.Bootstrapper/ConsoleRunnerStrategies/UnixPInvoke.cs
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
src/Paket.Bootstrapper/ConsoleRunnerStrategies/WindowsConsoleRunner.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.