Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!script) {
const options = logger.colors.blue(scripts.join(', '));
logger.error(`Unknown script '${script}'; please choose from one of: ${options}.`);
return process.exit(1);
}
// Print help doc and quit
if (argv.includes('--help') && script) {
const docPath = join(dir, '../docs', script) + '.md';
if (!existsSync(docPath)) {
logger.warning(`No documentation was found for ${script}`);
return process.exit(1);
}
markedRender(docPath);
return process.exit(0);
}
const nodeArgs = scriptIndex > 0 ? argv.slice(0, scriptIndex) : [];
const scriptPath = require.resolve(`./scripts/${script}`);
const scriptArgs = argv.slice(scriptIndex + 1);
const processArgs = nodeArgs.concat(scriptPath).concat(scriptArgs);
// Temp disallow version while we figure this out
if (script !== 'test') {
processArgs.push('--disallow-versioning');
}
const { exitCode } = await spawn('node', processArgs);
exit(exitCode, argv);
};
if (!script) {
const options = logger.colors.blue(scripts.join(', '));
logger.error(`Unknown script '${script}'; please choose from one of: ${options}.`);
return process.exit(1);
}
// Print help doc and quit
if (argv.includes('--help') && script) {
const docPath = join(dir, '../docs', script) + '.md';
if (!existsSync(docPath)) {
logger.warning(`No documentation was found for ${script}`);
return process.exit(1);
}
markedRender(docPath);
return process.exit(0);
}
const nodeArgs = scriptIndex > 0 ? argv.slice(0, scriptIndex) : [];
const scriptPath = require.resolve(`./scripts/${script}`);
const scriptArgs = argv.slice(scriptIndex + 1);
const processArgs = nodeArgs.concat(scriptPath).concat(scriptArgs);
// Temp disallow version while we figure this out
if (script !== 'test') {
processArgs.push('--disallow-versioning');
}
// Run the script
const { exitCode } = await spawn('node', processArgs);