Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
path.join(target, 'source/runtime.php'),
fs.readFileSync(path.join(target, 'source/runtime.php'))
.toString()
.replace('{{version}}', config.version)
);
} catch(err) {
return console.error(err);
}
// Delete .htaccess, database.php
del.sync(path.join(target, '.htaccess'));
del.sync(path.join(target, 'database.php'));
// Empty backups, content/cache, content/themes, content/uploads
del.sync(path.join(target, 'backups/*'));
del.sync(path.join(target, 'content/cache/*'));
del.sync([
path.join(target, 'content/themes/*'),
'!' + path.join(target, 'content/themes/range')
]);
del.sync([
path.join(target, 'content/uploads/*'),
'!' + path.join(target, 'content/uploads/2016')
]);
del.sync(path.join(target, 'content/plugins/*'));
// Prune source/images, source/scripts, and source/styles
del.sync(path.join(target, 'source/images/**'));
del.sync(path.join(target, 'source/scripts/**'));
del.sync(path.join(target, 'source/styles/**'));
// delete log folder
const fs = require("fs-extra");
const del = require("del");
// Delete .out directory
del.sync("./out");
// copy templates/*
fs.copySync("./src/templates", "./out/templates");
// copy test resources
fs.copySync("./src/test/resources", "./out/test/resources");
function createBundle(context, profile) {
let bundleConfig = require('./webpack.bundle')(context, profile)
del.sync(join(serverFolder, bundleFolder))
if (Object.keys(bundleConfig.entry).length === 0) {
return
}
if (typeof context.beforeBundleCreate === 'function') {
bundleConfig = mergeConfig(
bundleConfig,
context.beforeBundleCreate(bundleConfig)
)
}
const bundleCompiler = webpack(bundleConfig)
function cb(err, stats) {
if (err) throw err
stats = stats.toJson()
stats.errors.forEach(err => console.error(err))
stats.warnings.forEach(err => console.warn(err))
path.join(this.$.env.paths.electronApp.extractedNodeModulesBin, '*'),
path.join(this.$.env.paths.electronApp.nodeModules, '.bin')
);
}
}
this.log.debug('deleting source files');
const exclude = [this.$.env.paths.electronApp.nodeModules].concat(
[
this.$.env.paths.electronApp.appAsar,
this.$.env.paths.electronApp.packageJson
],
excludeFromDel
);
del.sync(
[`${this.$.env.paths.electronApp.root}${path.sep}*`].concat(
exclude.map(pathToExclude => `!${pathToExclude}`)
)
);
resolve();
}
);
gulp.task('clean-pebble', function() {
del.sync(paths.pebble.cdist);
});
gulp.task('clean', function (cb) {
return del.sync(['./dist'], cb());
});
gulp.task('unit', function (done) {
del.sync('./coverage/**');
return new Server({
configFile: path.join(basePath, 'karma.conf.js'),
singleRun: true
}, done).start();
});
function cleanEmptyDir(target) {
const list = glob.sync('**', {
cwd: target,
nodir: false,
});
for (let i = list.length - 1; i >= 0; i--) {
const filePath = path.join(target, list[i]);
if (fs.statSync(filePath).isDirectory()) {
if (0 === fs.readdirSync(filePath).length) {
del.sync(filePath);
}
}
}
}
function cleanSync(deleteVsix: boolean) {
del.sync('install.*');
del.sync('.omnisharp*');
del.sync('.debugger');
del.sync('.razor');
if (deleteVsix) {
del.sync('*.vsix');
}
}