Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function exit(text) {
if (text instanceof Error) {
console.error(
color.red(`${text.detail ? `${text.detail}\n` : ''}${text.stack}`)
);
} else {
console.error(color.red(text));
}
process.exit(1);
}
function resolveEnvironmentConfig(opts, allConfigs) {
const environment = opts.env || process.env.NODE_ENV || 'development';
const result = allConfigs[environment] || allConfigs;
if (allConfigs[environment]) {
console.log('Using environment:', color.magenta(environment));
}
if (!result) {
console.log(color.red('Warning: unable to read knexfile config'));
process.exit(1);
}
if (argv.debug !== undefined) {
result.debug = argv.debug;
}
return result;
}
const fatal = (src, dest, err) => {
console.error(`(${name}) '${red(src)}' -> '${red(dest)}' (${red(cross)})`);
console.error(`\n ${err}\n`);
process.exit(err.errno);
};
function exit(text) {
if (text instanceof Error) {
console.error(
color.red(`${text.detail ? `${text.detail}\n` : ''}${text.stack}`)
);
} else {
console.error(color.red(text));
}
process.exit(1);
}
const exitWithError = error => {
process.stderr.write(`${bold(red(error))}\n\n`);
process.exit(1);
};
error(...args) {
if (this.options.logLevel < 1) {
return
}
process.exitCode = process.exitCode || 1
console.error(colors.red('error'), ...args)
}
if (!options) {
options = {};
}
if (options.browser) {
throw new Error('Change `browser` option to `overrideBrowserslist` in Autoprefixer');
} else if (options.browserslist) {
throw new Error('Change `browserslist` option to `overrideBrowserslist` in Autoprefixer');
}
if (options.overrideBrowserslist) {
reqs = options.overrideBrowserslist;
} else if (options.browsers) {
if (typeof console !== 'undefined' && console.warn) {
if (colorette.red) {
console.warn(colorette.red(WARNING.replace(/`[^`]+`/g, function (i) {
return colorette.yellow(i.slice(1, -1));
})));
} else {
console.warn(WARNING);
}
}
reqs = options.browsers;
}
var brwlstOpts = {
ignoreUnknownVersions: options.ignoreUnknownVersions,
stats: options.stats
};
function loadPrefixes(opts) {
constructor(message, meta, program) {
const spaces = " ".repeat(3);
const msg = spaces + c.red("Error: " + message) + "\n" + spaces +
`Type ${c.bold(program.bin() + ' --help')} for help.\n`;
super(msg);
this.name = this.constructor.name;
this.originalMessage = message;
this.meta = meta;
Error.captureStackTrace(this, this.constructor);
}
}