Skip to content

DSakura207/Cake.Npx

 
 

Repository files navigation

Cake.Npx

appveyor nuget MIT License semantic-release

Cake alias for executing npx commands.

Installation

In your cake script add the following line (replacing version with the version you want to pin to)

#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Npx&version=1.0.0"

Usage

// =============================================================
// Executes npx with the specified command.
// =============================================================
Npx("semantic-release");

// =============================================================
// Executes npx with the specified command and captures the
// standard output.
// =============================================================
string[] redirectedStandardOutput = null;
Npx("semantic-release", out redirectedStandardOutput);

// =============================================================
// Executes npx with the specified command and additional arguments.
// =============================================================
Npx("semantic-release", "--dry-run");
Npx("semantic-release", args => args.Append("--dry-run"));

// =============================================================
// Executes npx with the specified command and additional arguments
// and captures the standard output.
// =============================================================
string[] redirectedStandardOutput = null;

Npx("semantic-release",
    "--dry-run",
    out redirectedStandardOutput);

Npx("semantic-release",
    args => args.Append("--dry-run"),
    out redirectedStandardOutput);

// =============================================================
// Executes npx with the specified command and additional packages.
// ========================================
Npx("semantic-release",
    settings => settings.AddPackage("@semantic-release/git"));

// Executes npx with the specified command and additional packages
// and captures the standard output.
// =============================================================
string[] redirectedStandardOutput = null;

Npx("semantic-release",
    settings => settings.AddPackage("@semantic-release/git"),
    out redirectedStandardOutput);

// =============================================================
// Executes npx with the specified command, additional arguments
// and packages.
// =============================================================
Npx("semantic-release",
    "--dry-run",
    settings => settings.AddPackage("@semantic-release/git"));

Npx("semantic-release",
    args => args.Append("--dry-run"),
    settings => settings.AddPackage("@semantic-release/git"));

// =============================================================
// Executes npx with the specified command, additional arguments
// and packages and captures the standard output.
// =============================================================
string[] redirectedStandardOutput = null;

Npx("semantic-release",
    "--dry-run",
    settings => settings.AddPackage("@semantic-release/git"),
    out redirectedStandardOutput);

Npx("semantic-release",
    args => args.Append("--dry-run"),
    settings => settings.AddPackage("@semantic-release/git"),
    out redirectedStandardOutput);

About

Cake alias for executing Npx commands

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 93.8%
  • JavaScript 3.3%
  • PowerShell 2.9%