Cleans up build scripts (#5097)

* Cleans up build scripts

* Adds back removeDir
This commit is contained in:
Henning Dieterichs 2025-11-07 13:10:14 +01:00 committed by GitHub
parent abae948dc3
commit d84acb4d8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 199 additions and 171 deletions

View file

@ -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.
*/