8

i’m trying to remove all .dot files, except .git and all *.js except one exception.js, but i’m failing

install

git clone git@github.com:iamstarkov/rimraf-test.git
cd rimraf-test

test

npm test # it fails

can anybody help me?

Vladimir Starkov
  • 19,264
  • 8
  • 60
  • 114

1 Answers1

5
var globby = require('globby');
var rimraf = require('rimraf');

globby(['*', '!authors.js', '!.git', '!dump'])
  .then(function then(paths) {
    paths.map(function map(item) {
      rimraf.sync(item);
    });
  });
Vladimir Starkov
  • 19,264
  • 8
  • 60
  • 114