Skip to content
Permalink
Browse files

fix: Fix clean method to return Promise always (#3501)

  • Loading branch information
Rokt33r authored and taion committed Mar 6, 2019
1 parent 42fb75e commit 6f0322371eb3201d1abf90dec1d02f5bf3880c30
Showing with 11 additions and 13 deletions.
  1. +11 −13 tools/build.js
@@ -15,7 +15,7 @@ const libRoot = path.join(__dirname, '../lib');
const distRoot = path.join(libRoot, 'dist');
const esRoot = path.join(libRoot, 'es');

const clean = () => fse.existsSync(libRoot) && fse.remove(libRoot);
const clean = () => fse.existsSync(libRoot) && fse.removeSync(libRoot);

const step = (name, root, fn) => async () => {
console.log(cyan('Building: ') + green(name));
@@ -75,15 +75,13 @@ console.log(
green(`Building targets: ${targets.length ? targets.join(', ') : 'all'}\n`),
);

clean()
.then(() =>
Promise.all([
has('lib') && buildLib(),
has('es') && buildEsm(),
has('dist') && buildDist(),
]),
)
.catch(err => {
if (err) console.error(red(err.stack || err.toString()));
process.exit(1);
});
clean();

Promise.all([
has('lib') && buildLib(),
has('es') && buildEsm(),
has('dist') && buildDist(),
]).catch(err => {
if (err) console.error(red(err.stack || err.toString()));
process.exit(1);
});

0 comments on commit 6f03223

Please sign in to comment.
You can’t perform that action at this time.