mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Ship ESM; Adopt latest deps
This commit is contained in:
parent
13c997af18
commit
ca775cc8f3
15 changed files with 8826 additions and 217 deletions
28
scripts/rmdir.js
Normal file
28
scripts/rmdir.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const target = path.join(process.cwd(), process.argv[2]);
|
||||
if (fs.existsSync(target)) {
|
||||
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