示例#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;
            }
        }
示例#2
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);
     }
 }