public NugetDownloader(CommandDirectory commandDirectory) { this.commandDirectory = commandDirectory; var sources = GetSources(); sourceInfos = sources.Select(s => new SourceInfo(s)).ToList(); }
private async static Task <int> RunAsync(string[] args) { const string usage = @".NET Commands Usage: dotnet commands install <command>[@<version>] [--force] [--pre] [--verbose] dotnet commands uninstall <command> [ --verbose] dotnet commands update (<command> | all) [--pre] [--verbose] dotnet commands (list|ls) [--verbose] dotnet commands --help dotnet commands --version Options: --force Installs even if package was already installed. Optional. --pre Include pre-release versions. Ignored if version is supplied. Optional. --verbose Verbose. Optional. --help -h Show this screen. --version -v Show version. "; var homeDir = Environment.GetEnvironmentVariable("HOME") ?? Environment.GetEnvironmentVariable("userprofile"); var commandDirectory = new CommandDirectory(Path.Combine(homeDir, ".nuget", "commands")); if (args.Length == 1 && args[0] == "bootstrap") { var installer = new Installer(commandDirectory); var success = await installer.InstallAsync("dotnet-commands", null, force : true, includePreRelease : true); return((int)(success ? ExitCodes.Success : ExitCodes.BootstrapFailed)); } var argsWithRun = args; if (args.Any() && args[0] != "commands") { argsWithRun = new[] { "commands" } }
public Lister(CommandDirectory commandDirectory) { this.commandDirectory = commandDirectory; }
public Installer(CommandDirectory commandDirectory) { this.commandDirectory = commandDirectory; }
public Updater(CommandDirectory commandDirectory) { this.commandDirectory = commandDirectory; }