provides wrappers around the common functions provided by the dotnet cli"
npm install dotnet-clidotnet-cli
---
Provides wrappers around the common functions provided by the dotnet cli
This library was ejected from zarro for
general-purpose usage
usage
---
dotnet-cli exports a collection of functions wrapping around system-wrapper,
using the dotnet cli. Functions that return a SystemResult may also throw
a SystemError if the dotnet command fails. Both SystemResult and SystemError
contain the captured stderr and stdout from the process so you can diagnose issues.
Available functions:
``javascript
listPackages(csproj: string): Promise
publish(opts: DotNetPublishOptions): Promise
clean(opts: DotNetCleanOptions): Promise
build(opts: DotNetBuildOptions): Promise
test(opts: DotNetTestOptions): Promise
incrementTempDbPortHintIfFound(env: Dictionary
listNugetSources(): Promise
addNugetSource(opts: NugetAddSourceOptions): Promise
removeNugetSource(source: string | NugetSource): Promise
enableNugetSource(source: string | NugetSource): Promise
disableNugetSource(source: string | NugetSource): Promise
tryFindConfiguredNugetSource(find: string | Partial
removeNugetSourceByName(find: string | Partial
pack(opts: DotNetPackOptions): Promise
nugetPush(opts: DotNetNugetPushOptions): Promise
resolveContainerOptions(opts: DotNetPublishOptions): Promise
searchPackages(options: DotNetSearchPackagesOptions | string): Promise
searchPackagesUncached(opts: DotNetSearchPackagesOptions): Promise
installPackage(opts: DotNetInstallNugetPackageOptions): Promise
create(opts: DotNetCreateOptions): Promise
addProjectToSolution(opts: DotNetAddProjectToSolutionOptions): Promise
listProjects(solutionFile: string): Promise
upgradePackages(opts: DotNetUpgradePackagesOptions): Promise
clearCaches(cacheType: DotNetCache | string): Promise
run(opts: DotNetRunProjectOptions): Promise
restore(opts: DotNetRestoreOptions): Promise
// also:
// provide custom logger functions (log and warn) to capture logs
// instead of outputting them
configureLoggers(customLoggers: Loggers);
// reset to default loggers (console.log, console.warn)
resetLoggers();
`
Examples:
1. build
`typescript
import { build } from "dotnet-cli";
await build({
target: "path/to/project-or-solution",
configuration: "Release"
});
`
2. test
`typescript
import { test } from "dotnet-cli";
await test({
target: "path/to/test-project-or-solution",
configuration: "Debug",
// optional logger config
loggers: {
"quackers": "normal"
}
});
``