@o3r/schematics
Version:
Schematics module of the Otter framework
28 lines • 1.03 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.NpmRunTask = void 0;
const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options");
const package_manager_runner_1 = require("../../utility/package-manager-runner");
/**
* Configuration used to run an Npm script during schematics execution
* Note that this only works if the necessary files are created on the disk (doesn't work on tree)
*/
class NpmRunTask {
constructor(script, workingDirectory) {
this.script = script;
this.workingDirectory = workingDirectory;
}
toConfiguration() {
return {
name: options_1.NodePackageName,
options: {
command: 'run',
packageName: `run ${this.script}`,
workingDirectory: this.workingDirectory,
packageManager: (0, package_manager_runner_1.getPackageManager)()
}
};
}
}
exports.NpmRunTask = NpmRunTask;
//# sourceMappingURL=npm-run.js.map
;