mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-12-04 22:20:49 +01:00
23 lines
366 B
JavaScript
23 lines
366 B
JavaScript
|
var fs = require('fs');
|
||
|
var path = require('path');
|
||
|
var rimraf = require('rimraf');
|
||
|
|
||
|
var cliArgs = process.argv.slice(2);
|
||
|
|
||
|
function rmdir_callback(err) {
|
||
|
if (err) {
|
||
|
throw err;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var i, dir;
|
||
|
|
||
|
for (i = 0; i < cliArgs.length; i++) {
|
||
|
|
||
|
dir = path.resolve(cliArgs[i]);
|
||
|
|
||
|
if (fs.existsSync(dir)) {
|
||
|
rimraf.sync(dir, {}, rmdir_callback);
|
||
|
}
|
||
|
}
|