how to remove everything with rimraf except few exceptions
Asked Answered
E

1

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 [email protected]:iamstarkov/rimraf-test.git
cd rimraf-test

test

npm test # it fails

can anybody help me?

Environs answered 20/12, 2015 at 23:33 Comment(0)
E
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);
    });
  });
Environs answered 22/12, 2015 at 23:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.