示例#1
0
        private Command(CommandSpec commandSpec)
        {
            var psi = new ProcessStartInfo
            {
                FileName        = commandSpec.Path,
                Arguments       = commandSpec.Args,
                UseShellExecute = false
            };

            _process = new Process
            {
                StartInfo = psi
            };

            ResolutionStrategy = commandSpec.ResolutionStrategy;
        }
示例#2
0
        private Command(CommandSpec commandSpec)
        {
            var psi = new ProcessStartInfo
            {
                FileName = commandSpec.Path,
                Arguments = commandSpec.Args,
                UseShellExecute = false
            };

            _process = new Process
            {
                StartInfo = psi
            };

            ResolutionStrategy = commandSpec.ResolutionStrategy;
        }
示例#3
0
        private Command(CommandSpec commandSpec)
        {
            var psi = new ProcessStartInfo
            {
                FileName               = commandSpec.Path,
                Arguments              = commandSpec.Args,
                RedirectStandardError  = true,
                RedirectStandardOutput = true
            };

            _stdOut = new StreamForwarder();
            _stdErr = new StreamForwarder();

            _process = new Process
            {
                StartInfo = psi
            };

            ResolutionStrategy = commandSpec.ResolutionStrategy;
        }
示例#4
0
文件: Command.cs 项目: ericstj/cli
        private Command(CommandSpec commandSpec)
        {
            var psi = new ProcessStartInfo
            {
                FileName = commandSpec.Path,
                Arguments = commandSpec.Args,
                RedirectStandardError = true,
                RedirectStandardOutput = true
            };

            _stdOut = new StreamForwarder();
            _stdErr = new StreamForwarder();

            _process = new Process
            {
                StartInfo = psi
            };

            ResolutionStrategy = commandSpec.ResolutionStrategy;
        }
示例#5
0
        private Command(CommandSpec commandSpec)
        {
            var psi = new ProcessStartInfo
            {
                FileName        = commandSpec.Path,
                Arguments       = commandSpec.Args,
                UseShellExecute = false
            };

            foreach (var environmentVariable in commandSpec.EnvironmentVariables)
            {
                if (!psi.Environment.ContainsKey(environmentVariable.Key))
                {
                    psi.Environment.Add(environmentVariable.Key, environmentVariable.Value);
                }
            }

            _process = new Process
            {
                StartInfo = psi
            };
        }
示例#6
0
 public static Command Create(CommandSpec commandSpec)
 {
     return(new Command(commandSpec));
 }
示例#7
0
文件: Command.cs 项目: ericstj/cli
 public static Command Create(CommandSpec commandSpec)
 {
     return new Command(commandSpec);
 }