mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Script to clean release directory
You can now do npm run clean:buildDir, ... clean:releaseDir, or just ... clean, which does both. The release directory is automatically cleaned before packaging commences.
This commit is contained in:
@@ -559,8 +559,7 @@ function cleanBuildDir(done) {
|
||||
if (BUILD_DIR === '.' || BUILD_DIR === '/') {
|
||||
throw new Error(`Refusing to rm -rf ${BUILD_DIR}`);
|
||||
}
|
||||
rimraf.sync(BUILD_DIR);
|
||||
done();
|
||||
rimraf(BUILD_DIR, done);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -366,33 +366,47 @@ function packageDTS() {
|
||||
.pipe(gulp.dest(`${RELEASE_DIR}`));
|
||||
};
|
||||
|
||||
/**
|
||||
* This task cleans the release directory (by deleting it).
|
||||
*/
|
||||
function cleanReleaseDir(done) {
|
||||
// Sanity check.
|
||||
if (RELEASE_DIR === '.' || RELEASE_DIR === '/') {
|
||||
throw new Error(`Refusing to rm -rf ${RELEASE_DIR}`);
|
||||
}
|
||||
rimraf(RELEASE_DIR, done);
|
||||
}
|
||||
|
||||
/**
|
||||
* This task prepares the files to be included in the NPM by copying
|
||||
* them into the release directory.
|
||||
*/
|
||||
const package = gulp.parallel(
|
||||
packageIndex,
|
||||
packageSources,
|
||||
packageCompressed,
|
||||
packageBrowser,
|
||||
packageNode,
|
||||
packageCore,
|
||||
packageNodeCore,
|
||||
packageBlockly,
|
||||
packageBlocks,
|
||||
packageJavascript,
|
||||
packagePython,
|
||||
packageLua,
|
||||
packageDart,
|
||||
packagePHP,
|
||||
packageLocales,
|
||||
packageMedia,
|
||||
packageUMDBundle,
|
||||
packageJSON,
|
||||
packageReadme,
|
||||
packageDTS
|
||||
);
|
||||
const package = gulp.series(
|
||||
cleanReleaseDir,
|
||||
gulp.parallel(
|
||||
packageIndex,
|
||||
packageSources,
|
||||
packageCompressed,
|
||||
packageBrowser,
|
||||
packageNode,
|
||||
packageCore,
|
||||
packageNodeCore,
|
||||
packageBlockly,
|
||||
packageBlocks,
|
||||
packageJavascript,
|
||||
packagePython,
|
||||
packageLua,
|
||||
packageDart,
|
||||
packagePHP,
|
||||
packageLocales,
|
||||
packageMedia,
|
||||
packageUMDBundle,
|
||||
packageJSON,
|
||||
packageReadme,
|
||||
packageDTS)
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
cleanReleaseDir: cleanReleaseDir,
|
||||
package: package,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user