Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const withEnvronment = () => {
const userDataPath = app.getPath('userData');
const nextDataPath = path.resolve(
userDataPath, `../Pathephone${!IS_PRODUCTION ? ` (${ENVIRONMENT})` : ''}`,
);
if (IS_TESTING) {
jetpack.remove(nextDataPath);
}
app.setPath('userData', nextDataPath);
if (IS_DEVELOPMENT) {
app.commandLine.appendSwitch('remote-debugging-port', '9223');
// require('electron-debug')({showDevTools: true})
require('electron-context-menu')({}); // eslint-disable-line global-require
}
};
test.after.always('remove test database file', () => remove(filePath))
after( () => {
fs.remove( configFile );
} );
function prune_task ( )
{
jetpack.remove ( './build/node_modules/sqlite3/build/' );
jetpack.remove ( './build/node_modules/sqlite3/deps/' );
jetpack.remove ( './build/node_modules/sqlite3/src/' );
jetpack.remove ( './build/node_modules/sqlite3/lib/binding/node-*' );
}
const tmpfolder = path.join(os.tmpdir(), 'glightbox-master');
await updateIndexVersion(args[0]);
await updatePackageVersion(args[0]);
jetpack.copy(folder, tmpfolder, {
matching: ['!node_modules', '!node_modules/**/*', '!.git', '!.git/**/*', '!.github', '!.github/**/*', '!.vscode', '!.vscode/**/*', '!*.psd', '!.DS_Store']
});
notify('Created folder', `Created folder correctly`);
const zip = await createZip(tmpfolder).catch(error => {
jetpack.remove(tmpfolder);
});
const folderName = path.basename(folder);
jetpack.remove(tmpfolder);
jetpack.move(zip, path.join(folder, folderName +'-master.zip'));
notify('Done', `Packaging process ended correctly`);
}
createFolder();
.then(() => {
jetpack.remove(captureOptions.file);
res.status(HTTP_STATUS_CODE.SUCCESS.CREATED).send();
next();
})
.catch((e) => {
destDir.dirAsync('.', { empty: true }).then(function() {
return jetpack.remove('output');
}).then(function() {
done();