Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const packageJson = require('../package.json');
/* eslint-disable no-sync */
updateNotifier({
packageName: packageJson.name,
packageVersion: packageJson.version
}).notify();
if (!fs.existsSync(path.join(process.cwd(), 'node_modules', 'roboter'))) {
buntstift.error('roboter is not installed locally.');
buntstift.newLine();
buntstift.info('Please run the following command:');
buntstift.newLine();
buntstift.info(' npm install roboter --save-dev --save-exact');
buntstift.exit(1);
}
const localRoboterPackageJson = require(path.join(
process.cwd(), 'node_modules', 'roboter', 'package.json'));
if (semver.gt(localRoboterPackageJson.version, packageJson.version)) {
buntstift.error('The roboter runner is too old.');
buntstift.newLine();
buntstift.info('Please run the following command:');
buntstift.newLine();
buntstift.info(' npm install -g roboter');
buntstift.exit(1);
}
const gulp = path.join(process.cwd(), 'node_modules', '.bin', 'gulp');
const configurationFile = minimist(process.argv.slice(2), {
string: 'file',
default: 'roboter.js'
}).file || 'roboter.js';
const configurationFileWithPath = path.join(process.cwd(), configurationFile);
if (!fs.existsSync(configurationFileWithPath)) {
buntstift.error(`${configurationFile} is missing.`);
buntstift.exit(1);
}
const args = process.argv.slice(2).join(' ');
buntstift.exit(shell.exec(
`${gulp} --gulpfile ${configurationFileWithPath} --color true ${args}`).code);
/* eslint-enable no-sync */