在Linux的命令行上使用用户ID和密码指定nuget源

时间:2018-07-31 09:41:44

标签: linux nuget .net-core-2.1

我想在Linux的命令行上使用用户ID和密码指定nuget源。

我看到的选项是:

$ dotnet nuget --help
NuGet Command Line 4.7.0.5

Usage: dotnet nuget [options] [command]

Options:
  -h|--help                   Show help information
  --version                   Show version information
  -v|--verbosity <verbosity>  The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, Error.

Commands:
  delete  Deletes a package from the server.
  locals  Clears or lists local NuGet resources such as http requests cache, packages cache or machine-wide global packages folder.
  push    Pushes a package to the server and publishes it.

Use "dotnet nuget [command] --help" for more information about a command.

$ dotnet --version
2.1.302

但是,如果我还使用以下命令安装nuget $ sudo apt-get install nuget 我得到

$ nuget help sources
usage: NuGet sources <List|Add|Remove|Enable|Disable|Update> -Name [name] -Source [source]

Provides the ability to manage list of sources located in %AppData%\NuGet\NuGet.config

options:

 -Name                                 Name of the source.
 -Source                        (src)  Path to the package(s) source.
 -UserName                             UserName to be used when connecting to an authenticated source.
 -Password                             Password to be used when connecting to an authenticated source.
 -StorePasswordInClearText             Enables storing portable package source credentials by disabling password encryption.
 -Format                               Applies to the list action. Accepts two values: Detailed (the default) and Short.
 -Help                          (?)    help
 -Verbosity                            Display this amount of details in the output: normal, quiet, detailed.
 -NonInteractive                       Do not prompt for user input or confirmations.
 -ConfigFile                           The NuGet configuration file. If not specified, file %AppData%\NuGet\NuGet.config is used as configurat
                                       ion file.

For more information, visit http://docs.nuget.org/docs/reference/command-line-reference

但是,安装nuget还会安装mono运行时,我们不需要也不使用它。当一起使用dotnet和mono时,我们还发现了其他问题。

是否可以在命令行中添加不涉及mono的私有nuget源?

编辑:我看到https://github.com/NuGet/Home/issues/6243对此进行了讨论,目前尚无命令行方法可以执行此操作,但是很高兴被证明是错误的。

0 个答案:

没有答案