Exemplo n.º 1
0
        public NugetDownloader(CommandDirectory commandDirectory)
        {
            this.commandDirectory = commandDirectory;
            var sources = GetSources();

            sourceInfos = sources.Select(s => new SourceInfo(s)).ToList();
        }
Exemplo n.º 2
0
        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" }
            }
Exemplo n.º 3
0
 public Lister(CommandDirectory commandDirectory)
 {
     this.commandDirectory = commandDirectory;
 }
Exemplo n.º 4
0
 public Installer(CommandDirectory commandDirectory)
 {
     this.commandDirectory = commandDirectory;
 }
Exemplo n.º 5
0
 public Updater(CommandDirectory commandDirectory)
 {
     this.commandDirectory = commandDirectory;
 }