public void Execute() { if (Help) { HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName); } else { if (String.IsNullOrEmpty(ConfigFile)) { Settings = NuGet.Settings.LoadDefaultSettings( FileSystem, configFileName: null, machineWideSettings: MachineWideSettings); } else { var directory = Path.GetDirectoryName(Path.GetFullPath(ConfigFile)); var configFileName = Path.GetFileName(ConfigFile); var configFileSystem = new PhysicalFileSystem(directory); // Create the config file when neccessary if (!configFileSystem.FileExists(configFileName) && ShouldCreateConfigFile) { XmlUtility.CreateDocument("configuration", configFileSystem, configFileName); } Settings = NuGet.Settings.LoadDefaultSettings( configFileSystem, configFileName, MachineWideSettings); } SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings); // Register an additional provider for the console specific application so that the user // will be prompted if a proxy is set and credentials are required var credentialProvider = new SettingsCredentialProvider( new ConsoleCredentialProvider(Console), SourceProvider, Console); HttpClient.DefaultCredentialProvider = credentialProvider; RepositoryFactory = new NuGet.Common.CommandLineRepositoryFactory(Console); // enable the V3 shim if (ShimControllerProvider != null) { ShimControllerProvider.Controller.Enable(SourceProvider); } ExecuteCommand(); } }
public void Execute() { if (Help) { HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName); } else { if (String.IsNullOrEmpty(ConfigFile)) { Settings = NuGet.Settings.LoadDefaultSettings( FileSystem, configFileName: null, machineWideSettings: MachineWideSettings); } else { var directory = Path.GetDirectoryName(Path.GetFullPath(ConfigFile)); var configFileName = Path.GetFileName(ConfigFile); var configFileSystem = new PhysicalFileSystem(directory); configFileSystem.Logger = Console; Settings = NuGet.Settings.LoadDefaultSettings( configFileSystem, configFileName, MachineWideSettings); } SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings); // Register an additional provider for the console specific application so that the user // will be prompted if a proxy is set and credentials are required var credentialProvider = new SettingsCredentialProvider( new ConsoleCredentialProvider(Console), SourceProvider, Console); HttpClient.DefaultCredentialProvider = credentialProvider; RepositoryFactory = new NuGet.Common.CommandLineRepositoryFactory(Console); ExecuteCommand(); } }
public void Execute() { if (Help) { HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName); } else { if (String.IsNullOrEmpty(ConfigFile)) { Settings = NuGet.Settings.LoadDefaultSettings( FileSystem, configFileName: null, machineWideSettings: MachineWideSettings); } else { var directory = Path.GetDirectoryName(Path.GetFullPath(ConfigFile)); var configFileName = Path.GetFileName(ConfigFile); var configFileSystem = new PhysicalFileSystem(directory); Settings = NuGet.Settings.LoadDefaultSettings( configFileSystem, configFileName, MachineWideSettings); } SourceProvider = PackageSourceBuilder.CreateSourceProvider(Settings); // Register an additional provider for the console specific application so that the user // will be prompted if a proxy is set and credentials are required var credentialProvider = new SettingsCredentialProvider( new ConsoleCredentialProvider(Console), SourceProvider, Console); HttpClient.DefaultCredentialProvider = credentialProvider; RepositoryFactory = new NuGet.Common.CommandLineRepositoryFactory(Console); ExecuteCommand(); } }
public void Execute() { if (Help) { HelpCommand.ViewHelpForCommand(CommandAttribute.CommandName); } else { RepositoryFactory = new CommandLineRepositoryFactory(Console); UserAgent.SetUserAgentString(new UserAgentStringBuilder(CommandLineConstants.UserAgent)); ExecuteCommandAsync().Wait(); } }