How to use del - 10 common examples

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 ukonpower / glsl-graphics / gulpfile.babel.js View on Github external
gulp.task('clean', (c) => {
    del([
        './public/',
    ], {
        force: true,
    }).then(paths => {
        // eslint-disable-next-line no-console
        c();
        console.log('Files and folders that would be deleted:\n', paths.join('\n'));
    });
});
github SunHuawei / SourceDetector / gulpfile.babel.js View on Github external
.pipe($.if('*.css', $.cleanCss({compatibility: '*'})))
  .pipe($.if('*.js', $.sourcemaps.init()))
  // .pipe($.if('*.js', $.uglify()))
  .pipe($.if('*.js', $.sourcemaps.write('.')))
  .pipe(gulp.dest('dist'));
});

gulp.task('babel', () => {
  return gulp.src('app/scripts.babel/**/*.js')
      .pipe($.babel({
        presets: ['es2015']
      }))
      .pipe(gulp.dest('app/scripts'));
});

gulp.task('clean', del.bind(null, ['.tmp', 'dist']));

gulp.task('watch', ['lint', 'babel'], () => {
  $.livereload.listen();

  gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
    'app/images/**/*',
    'app/styles/**/*',
    'app/_locales/**/*.json'
  ]).on('change', $.livereload.reload);

  gulp.watch('app/scripts.babel/**/*.js', ['lint', 'babel']);
  gulp.watch('bower.json', ['wiredep']);
});
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 osmlab / learnoverpass / gulpfile.js View on Github external
});

gulp.task('partials', ['styles'], function () {
  var assets = $.useref.assets({searchPath: '{.tmp,themes/src}'});

  return gulp.src('themes/src/layouts/**/*.html')
    .pipe(assets)
    .pipe($.if('*.js', $.uglify()))
    .pipe($.if('*.css', $.csso()))
    .pipe(assets.restore())
    .pipe($.useref())
    .pipe($.if('*.html', $.htmlclean()))
    .pipe(gulp.dest(theme + 'layouts/'));
});

gulp.task('clean', require('del').bind(null, [theme + 'layouts', theme + 'static/assets/css/*.css', theme + 'static/assets/*.js']));

gulp.task('watch', function () {
  // watch for changes
  gulp.watch([
    '*.html',
    theme + 'static/css/**/*.css',
    'scripts/**/*.js',
  ]).on('change', $.livereload.changed);

  gulp.watch('themes/src/styles/**/*.styl', ['styles']);
  gulp.watch('themes/src/scripts/**/*.js', ['scripts']);
  gulp.watch('themes/src/**/*.html', ['html']);
  gulp.watch('themes/src/**/*.html', ['partials']);
});

gulp.task('clearcache', function() {
github germanattanasio / movieapp-dialog / gulpfile.js View on Github external
'baseDir': [ '.tmp', 'app', '.tmp_examples' ]
      },
      'ports': {
       'min': 9090,
       'max': 9090
      }
    });

    gulp.watch([srcFolder + '/**/*.html'], [ 'html:compile', reload ]);
    gulp.watch([srcFolder + '/**/*.{css,scss}'], ['styles']);
    gulp.watch(['.tmp/styles/**/*.css'], reload);
    gulp.watch([srcFolder + '/**/*.js'], [ 'js:compile', reload ]);
//    gulp.watch(['app/fonts/**/*'], ['fonts']);
  });

  gulp.task('clean', del.bind(null, [ '.tmp', 'test_out', distFolder ]));

  gulp.task('dist', ['clean'], function (cb) {
    runSequence('styles', [ 'html', 'fonts', 'images' ], cb);
  });


  gulp.task('default', [], function (cb) {
    runSequence('dist', cb);
  });

  gulp.task('test', ['bower'], function () {
    return gulp.src('./idontexist') // https://github.com/lazd/gulp-karma/issues/9
      .pipe($.karma({
        'configFile': './karma.conf.js',
        'autoWatch': false
      }))
github philtoms / mithril-starter-kit / gulpfile.js View on Github external
var pkgs = (function() {
  var pkgs = {};
  var map = function(source) {
    for (var key in source) {
      pkgs[key.replace(/[^a-z0-9]/gi, '')] = source[key].substring(1);
    }
  };
  map(require('./package.json').dependencies);
  return pkgs;
}());

// The default task
gulp.task('default', ['serve']);

// Clean up
gulp.task('clean', del.bind(null, [DEST]));

// 3rd party libraries
gulp.task('vendor', function() {
  src.vendor = [
    'bower_components/todomvc-common/base.{js,css}',
    'bower_components/todomvc-common/bg.png'
  ];
  return merge(
    gulp.src(src.vendor)
      .pipe(gulp.dest(DEST + '/vendor')),
    gulp.src('./node_modules/bootstrap/dist/fonts/**')
      .pipe(gulp.dest(DEST + '/fonts'))
  );
});

// Static files
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 Lucifier129 / react-imvc / src / build / index.ts View on Github external
const delPublish: DelPublish = (folder) => {
  console.log(`delete publish folder: ${folder}`)
  return del(folder)
}
github jalalmostafa / chrome-prayertimes / gulpfile.babel.js View on Github external
})))
        .pipe($.if('*.js', $.sourcemaps.init()))
        .pipe($.if('*.js', $.uglify()))
        .pipe($.if('*.js', $.sourcemaps.write('.')))
        .pipe(gulp.dest('dist'));
});

gulp.task('babel', () => {
    return gulp.src('app/scripts.babel/**/*.js')
        .pipe($.babel({
            presets: ['es2015']
        }))
        .pipe(gulp.dest('app/scripts'));
});

gulp.task('clean', del.bind(null, ['.tmp', 'dist']));

gulp.task('watch', ['lint', 'babel'], () => {
    $.livereload.listen();

    gulp.watch([
        'app/*.html',
        'app/scripts/**/*.js',
        'app/images/**/*',
        'app/styles/**/*',
        'app/_locales/**/*.json'
    ]).on('change', $.livereload.reload);

    gulp.watch('app/scripts.babel/**/*.js', ['lint', 'babel']);
    gulp.watch('bower.json', ['wiredep']);
});

del

Delete files and directories

MIT
Latest version published 2 months ago

Package Health Score

85 / 100
Full package analysis

Popular del functions