@rxap/plugin-utilities
Version:
Provides utility functions for Nx plugins, such as retrieving project dependencies, determining output paths, and interacting with package.json files. It simplifies common tasks within Nx executors and generators. This package helps streamline plugin deve
26 lines • 832 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.YarnRun = YarnRun;
const child_process_1 = require("child_process");
function YarnRun(args) {
console.log(`$ yarn ${args.join(' ')}`);
return new Promise((resolve, reject) => {
const s = (0, child_process_1.spawn)('yarn', args, {
stdio: ['ignore', 'pipe', 'inherit'],
shell: true,
});
s.on('error', (err) => {
if (err.code === 'ENOENT') {
console.error('Yarn must be installed to use the CLI.');
}
else {
reject(err);
}
});
s.stdout.on('data', (data) => {
console.log(data.toString('utf-8'));
});
s.on('close', resolve);
});
}
//# sourceMappingURL=yarn-run.js.map