From c9a8b90b98347ed3f56bc4e43984dd312eea5657 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 18 Aug 2022 16:20:41 +0100 Subject: [PATCH] fix(build): Have prepare task signal async completion PR #6244 made a change to have the npm run prepare script (automatically invoked by npm install after package installation) not bother running the buildJavaScriptAndDeps gulp task when run from a GitHub action (since our build action will do npm test straight afterwards, which runs this task already). Unfortunately, due my misunderstanding of how gulp tasks work the revised version generated a "Did you forget to signal async completion?" error from gulp. Fix this by adding a done parameter and passing the provided callback to buildJavaScriptAndDeps. This also allows a simplification of the the don't-run case by simply calling done and then returning. --- scripts/gulpfiles/build_tasks.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index f7132583d45..8521bf6d669 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -295,11 +295,12 @@ var JSCOMP_OFF = [ * needed, and we don't want to, because a tsc error would prevent * other workflows (like lint and format) from completing. */ -function prepare() { +function prepare(done) { if (process.env.CI) { - return gulp.src('.'); // Do nothing. + done(); + return; } - return buildJavaScriptAndDeps(); + return buildJavaScriptAndDeps(done); } const buildJavaScriptAndDeps = gulp.series(buildJavaScript, buildDeps);