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;
};
}[];
}