Ejemplo n.º 1
0
        public override int Run(string[] remainingArguments)
        {
            try
            {
                SetDefaultOptionValues();

                if (!_nPloyConfiguration.HasInstalledPackages(WorkingDirectory))
                {
                    Console.WriteLine("Nothing to start");
                    return 0;
                }
                Console.WriteLine("Start node in: " + WorkingDirectory);
                var installedPackages = _nPloyConfiguration.GetInstalledPackges(WorkingDirectory);

                foreach (var package in installedPackages)
                {
                    var startPackageCommand = new StartPackageCommand
                        {
                            WorkingDirectory = WorkingDirectory
                        };
                    var result = startPackageCommand.Run(new[] { package.FullName });
                    if (result > 0)
                        return result;
                }

                return 0;
            }
            catch (ConsoleException c)
            {
                return c.ExitCode;
            }
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     _nPloyConfiguration = new Mock<INPloyConfiguration>();
     _powershellRunner = new Mock<IPowershellRunner>();
     _command = new StartPackageCommand(_nPloyConfiguration.Object, _powershellRunner.Object);
 }
Ejemplo n.º 3
0
 private void StartPackages(IEnumerable<string> installedPackages)
 {
     var startPackageCommand = new StartPackageCommand();
     foreach (var installedPackage in installedPackages)
     {
         startPackageCommand.WorkingDirectory = InstallDirectory;
         var exitCode = startPackageCommand.Run(new[] { installedPackage });
         if (exitCode > 0)
             throw new ConsoleException(exitCode);
     }
 }