Skip to content

Commit

Permalink
Use only managed code
Browse files Browse the repository at this point in the history
  • Loading branch information
vbfox committed Oct 15, 2016
1 parent 4394c6c commit 223ad2e
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 446 deletions.
39 changes: 39 additions & 0 deletions src/Paket.Bootstrapper/ConsoleRunner.cs
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 src/Paket.Bootstrapper/ConsoleRunnerStrategies/ConsoleRunner.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Paket.Bootstrapper/ConsoleRunnerStrategies/IConsoleRunner.cs

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions src/Paket.Bootstrapper/ConsoleRunnerStrategies/UnixPInvoke.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit 223ad2e

Please sign in to comment.