Example #1
0
 public static PackageConfig GetPackageConfig(string package)
 {
     PackageConfig packageConfig = null;
     var regex = new Regex(@"(.*?)\.(\d+(\.\d+)+.*)");
     var match = regex.Match(package);
     if (match.Success)
     {
         packageConfig = new PackageConfig {Id = match.Groups[1].Value, Version = match.Groups[2].Value};
     }
     return packageConfig;
 }
Example #2
0
 private void UninstallPackage(PackageConfig package)
 {
     var uninstallPackageCommand = _commandFactory.GetCommand<UninstallPackageCommand>();
     uninstallPackageCommand.WorkingDirectory = InstallDirectory;
     var exitCode = uninstallPackageCommand.Run(new[] { package.FullName });
     if (exitCode > 0)
         throw new ConsoleException(exitCode);
 }
Example #3
0
 private void InstallPackage(PackageConfig package, string nployConfigurationPath)
 {
     var installPackageCommand = _commandFactory.GetCommand<InstallPackageCommand>();
     installPackageCommand.WorkingDirectory = InstallDirectory;
     installPackageCommand.PackageSources = PackageSources;
     installPackageCommand.ConfigurationDirectory = nployConfigurationPath;
     installPackageCommand.NuGetPath = NuGetPath;
     installPackageCommand.Version = package.Version;
     installPackageCommand.Environment = GetEnvironmentFromFile();
     installPackageCommand.Verbose = Verbose;
     installPackageCommand.Properties = Properties;
     installPackageCommand.IncludePrerelease = IncludePrerelease;
     var exitCode = installPackageCommand.Run(new[] { package.Id });
     if (exitCode > 0)
         throw new ConsoleException(exitCode);
 }