How to use the del.sync function in del

To help you get started, we’ve selected a few del examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Leafpub / leafpub / gulpfile.js View on Github external
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
github mickeypearce / oradew-vscode / scripts / precompile.js View on Github external
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");
github ali322 / nva / packages / nva-task / lib / isomorphic / index.js View on Github external
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))
github wojtkowiak / meteor-desktop / lib / electronApp.js View on Github external
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();
                }
            );
github bhdouglass / simply-light / gulpfile.js View on Github external
gulp.task('clean-pebble', function() {
    del.sync(paths.pebble.cdist);
});
github JavaTMP / bootstrap-modal-wrapper / gulpfile.js View on Github external
gulp.task('clean', function (cb) {
    return del.sync(['./dist'], cb());
});
github outbrain / postit / gulpfile.js View on Github external
gulp.task('unit', function (done) {
	del.sync('./coverage/**');

	return new Server({
		configFile: path.join(basePath, 'karma.conf.js'),
		singleRun: true
	}, done).start();
});
github sony / cdp-js / packages / master-tasks / tasks / clean.js View on Github external
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);
            }
        }
    }
}
github OmniSharp / omnisharp-vscode / tasks / offlinePackagingTasks.ts View on Github external
function cleanSync(deleteVsix: boolean) {
    del.sync('install.*');
    del.sync('.omnisharp*');
    del.sync('.debugger');
    del.sync('.razor');

    if (deleteVsix) {
        del.sync('*.vsix');
    }
}

del

Delete files and directories

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis

Popular del functions