Move release script off of gulp

This commit is contained in:
Alex Dima 2021-11-16 20:04:55 +01:00
parent 68d7a125ad
commit cf27b4665e
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
5 changed files with 521 additions and 597 deletions

View file

@ -15,6 +15,7 @@ const alias = require('esbuild-plugin-alias');
const REPO_ROOT = path.join(__dirname, '../');
exports.REPO_ROOT = REPO_ROOT;
const existingDirCache = new Set();
/**
* @param {string} dirname
*/
@ -27,12 +28,16 @@ function ensureDir(dirname) {
dirname = path.dirname(dirname);
}
dirs.reverse();
dirs.forEach(function (dir) {
try {
fs.mkdirSync(dir);
} catch (err) {}
dirs.forEach((dir) => {
if (!existingDirCache.has(dir)) {
try {
fs.mkdirSync(dir);
} catch (err) {}
existingDirCache.add(dir);
}
});
}
exports.ensureDir = ensureDir;
/**
* Copy a file.