Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logVerify(blacklisted);
});
}
if (!env.modulePath) {
/* istanbul ignore next */
var missingNodeModules =
fs.existsSync(path.join(env.cwd, 'package.json'))
&& !fs.existsSync(path.join(env.cwd, 'node_modules'));
/* istanbul ignore next */
var missingGulpMessage =
missingNodeModules
? 'Local modules not found in'
: 'Local gulp not found in';
log.error(
ansi.red(missingGulpMessage),
ansi.magenta(tildify(env.cwd))
);
/* istanbul ignore next */
var installCommand =
missingNodeModules
? 'npm install'
: 'npm install gulp';
log.error(ansi.red('Try running: ' + installCommand));
exit(1);
}
if (!env.configPath) {
log.error(ansi.red('No gulpfile found'));
exit(1);
}
gulpInst.on('error', function(evt) {
var msg = formatError(evt);
var time = prettyTime(evt.duration);
var level = evt.branch ? 'debug' : 'error';
log[level](
'\'' + ansi.cyan(evt.name) + '\'',
ansi.red('errored after'),
ansi.magenta(time)
);
// If we haven't logged this before, log it and add to list
if (loggedErrors.indexOf(evt.error) === -1) {
log.error(msg);
loggedErrors.push(evt.error);
}
});
}
var output = JSON.stringify(copyTree(tree, opts));
if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) {
return console.log(output);
}
return fs.writeFileSync(opts.tasksJson, output, 'utf-8');
}
try {
log.info('Using gulpfile', color.highlight(tildify(env.configPath)));
gulpInst.parallel(toRun)(function(err) {
if (err) {
exit(1);
}
});
} catch (err) {
log.error(color.error(err.message));
log.error('To list available tasks, try running: gulp --tasks');
exit(1);
}
});
}
inquirer.prompt([bumpTypeQuestion], function( answers ) {
if (answers !== null && answers[bumpTypeQuestion.name] !== null) {
bumpVersion(answers[bumpTypeQuestion.name], done);
} else {
logger.error('ERR: There was an error with the provided bump type');
process.exit(1);
}
});
}
gulpInst.on('task_not_found', function(err) {
log.error(
color.error('Task \'' + err.task + '\' is not in your gulpfile')
);
log.error('Please check the documentation for proper gulpfile formatting');
exit(1);
});
}
}
let packs = [...this.packs];
if (type) {
packs = packs.filter(p => !type || p.types.some(t => t === type));
}
const tasks = packs.map(p => {
const task = (taskDone) => {
return action(p, taskDone);
};
task.displayName = `${description}: ${p.relativePath}`;
return task;
});
if (tasks.length === 0) {
log.error("No packs found");
done();
return;
}
const completeDynamicTasks = (seriesDone) => {
seriesDone();
done();
};
completeDynamicTasks.displayName = `${description}: completeDynamicTasks`;
//FIXME: find a way to invoke done() in a way that's safe for parallel that doesn't involve creating a bogus task in the task list.
//If I were using series, I could simply invoke it when the last pack is being processed.
return series(
parallel(...tasks),
completeDynamicTasks
)();
async postInstall() {
let appRoot = path.join(
XDE_ROOT,
'node_modules/electron-prebuilt/dist/Electron.app'
);
let xdeIconsPath = path.join(XDE_ROOT, 'dev/xde.icns');
let appIconsPath = path.join(appRoot, 'Contents/Resources/electron.icns');
try {
await fs.promise.copy(xdeIconsPath, appIconsPath);
logger.info(crayon.green('Copied icons into electron-prebuilt'));
} catch (error) {
logger.error('Failed to copy icons into electron-prebuilt');
logger.error(error.stack);
}
},
};
var waitForChanges = (waitDone) => {
if (!this.watchGlobs.size) {
gulpLog.error('nothing to watch');
waitDone();
return;
}
gulpWatch(Array.from(this.watchGlobs), gulpBatch((events, batchDone) => {
gulpLog.info('WATCHING: got change event');
runBuildTargets(batchDone);
}));
};