mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Cleans up build scripts (#5097)
* Cleans up build scripts * Adds back removeDir
This commit is contained in:
parent
abae948dc3
commit
d84acb4d8f
8 changed files with 199 additions and 171 deletions
15
build/fs.ts
15
build/fs.ts
|
|
@ -23,25 +23,12 @@ export function ensureDir(dirname: string) {
|
|||
if (!existingDirCache.has(dir)) {
|
||||
try {
|
||||
fs.mkdirSync(dir);
|
||||
} catch (err) {}
|
||||
} catch (err) { }
|
||||
existingDirCache.add(dir);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file.
|
||||
*/
|
||||
export function copyFile(_source: string, _destination: string) {
|
||||
const source = path.join(REPO_ROOT, _source);
|
||||
const destination = path.join(REPO_ROOT, _destination);
|
||||
|
||||
ensureDir(path.dirname(destination));
|
||||
fs.writeFileSync(destination, fs.readFileSync(source));
|
||||
|
||||
console.log(`Copied ${_source} to ${_destination}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a directory and all its contents.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue