Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(userOutputDirPath) => {
if (userOutputDirPath === undefined) {
event.sender.send(EXPORT_CANCEL);
} else {
fs.mkdir(tmpOutputDirPath)
.then(() => fs.writeFile(tmpOutputColorsPath, colorsFileContents))
.then(() => {
themer(tmpOutputColorsPath, templates, tmpOutputDirPath, {}).subscribe(
status => event.sender.send(EXPORT_PROGRESS, status),
err => event.sender.send(EXPORT_ERROR, err.toString()),
() => {
copy(tmpOutputDirPath, userOutputDirPath)
.then(() => event.sender.send(EXPORT_COMPLETE, userOutputDirPath))
.catch(err => event.sender.send(EXPORT_ERROR, err.toString()));
}
);
})
.catch(err => event.sender.send(EXPORT_ERROR, err.toString()));
}
}
);
}
if (parsoidOptions.localsettings) {
parsoidOptions.localsettings = path.resolve(__dirname, parsoidOptions.localsettings);
}
var nock, dir, nocksFile;
if (argv.record || argv.replay) {
if (!argv.pageName) {
throw new Error(
'pageName must be specified to use --record or --replay'
);
}
dir = path.resolve(__dirname, '../nocks/');
if (!(yield fs.exists(dir))) {
yield fs.mkdir(dir);
}
dir = dir + '/' + (domain || prefix || 'enwiki');
if (!(yield fs.exists(dir))) {
yield fs.mkdir(dir);
}
nocksFile = dir + '/' + encodeURIComponent(argv.pageName || 'stdin') + '.js';
if (argv.record) {
nock = require('nock');
nock.recorder.rec({ dont_print: true });
} else {
require(nocksFile);
}
}
var logLevels;
if (!argv.verbose) {
}
var nock, dir, nocksFile;
if (argv.record || argv.replay) {
if (!argv.pageName) {
throw new Error(
'pageName must be specified to use --record or --replay'
);
}
dir = path.resolve(__dirname, '../nocks/');
if (!(yield fs.exists(dir))) {
yield fs.mkdir(dir);
}
dir = dir + '/' + (domain || prefix || 'enwiki');
if (!(yield fs.exists(dir))) {
yield fs.mkdir(dir);
}
nocksFile = dir + '/' + encodeURIComponent(argv.pageName || 'stdin') + '.js';
if (argv.record) {
nock = require('nock');
nock.recorder.rec({ dont_print: true });
} else {
require(nocksFile);
}
}
var logLevels;
if (!argv.verbose) {
logLevels = ["fatal", "error", "warn"];
}
var envOptions = {