mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Refactor project shape
This commit is contained in:
parent
5c70cefbad
commit
92af97ca38
25 changed files with 96 additions and 104 deletions
21
scripts/rmdir.js
Normal file
21
scripts/rmdir.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const target = path.join(process.cwd(), process.argv[2]);
|
||||
rmDir(target);
|
||||
console.log(`Deleted ${process.argv[2]}`);
|
||||
|
||||
function rmDir(dirPath) {
|
||||
let entries = fs.readdirSync(dirPath);
|
||||
if (entries.length > 0) {
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
var filePath = path.join(dirPath, entries[i]);
|
||||
if (fs.statSync(filePath).isFile()) {
|
||||
fs.unlinkSync(filePath);
|
||||
} else {
|
||||
rmDir(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
fs.rmdirSync(dirPath);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue