@testdozer/ng-cmd-builder
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

Build Status NPM version:latest NPM version:next npm downloads Commitizen friendly semantic-release Renovate enabled License

This is an angular CLI builder that executes a cmd command. It runs the command with nodejs spawn.

At the moment the angular workspace does not support schematics projects and another nodejs projects due the lack of available builders.

npm install @testdozer/ng-cmd-builder -D

in angular.json

  "architect": {
        "build": {
          "builder": "@testdozer/ng-cmd-builder:build",
          "options": {
            "commands": [
              { "command": "npm run builder:build" },
              {
                "command": "npx cpy",
                "args": [
                    "./projects/ng-cmd-builder/package.json",
                    "./dist/ng-cmd-builder"
                ],
                "options":{
                  "env": {"ENVIRONMENT_PARAM": "value"}
                },
              }
            ]
          }
        }
  }

The builder supports options that reflect subset of spawn options, and they have the same meaning. Supported schema.json

/**
 * Options for CMD Builder
 */
export interface Schema {
    commands: {
        /**
         * The command to run.
         */
        command: string;
        /**
         * List of string arguments.
         */
        args?: string[];
        /**
         * Environment key-value pairs.
         */
        options?: {
            env?: { [name: string]: string };
            /**
             * Current working directory
             */
            cwd?: string;
            /**
             * <boolean> | <string> If true, runs command inside of a shell. Uses '/bin/sh' on Unix, and process.env.ComSpec on Windows.
             * A different shell can be specified as a string. See Shell requirements and Default Windows shell. Default: true.
             */
            shell: string;
            /**
             * Hide the subprocess console window that would normally be created on Windows systems.
             */
            windowsHide?: boolean;
        };
    }[];
}

Sponsored by 2BIT GmbH

Readme

Keywords

Package Sidebar

Install

npm i @testdozer/ng-cmd-builder

Weekly Downloads

4

Version

2.2.0

License

MIT

Unpacked Size

72.3 kB

Total Files

31

Last publish

Collaborators

  • dvabuzyarov