Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit ec64de3

Browse files
Splaktarmmalerba
authored andcommitted
build(release): detect that gulp is not installed globally (#11737)
this provides an early failure with a clear message rather than failing on later calls to `exec()` which ignore stderr
1 parent 6d41a08 commit ec64de3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

release.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
const lastMajorVer = JSON.parse(exec('curl https://material.angularjs.org/docs.json')).latest;
2020
let newVersion;
2121

22+
try {
23+
child_process.execSync('gulp --version', defaultOptions);
24+
} catch (error) {
25+
throw new Error('Please install gulp globally via "npm i -g gulp@^3.9.1".');
26+
}
2227
header();
2328
const dryRun = prompt(`Is this a dry-run? [${"yes".cyan}/no] `, 'yes') !== 'no';
2429

@@ -401,7 +406,12 @@
401406
log('done'.green);
402407
}
403408

404-
/** utility method for executing terminal commands */
409+
/**
410+
* utility method for executing terminal commands while ignoring stderr
411+
* @param {string|Array} cmd
412+
* @param {Object=} userOptions
413+
* @return
414+
*/
405415
function exec (cmd, userOptions) {
406416
if (cmd instanceof Array) {
407417
return cmd.map(function (cmd) { return exec(cmd, userOptions); });

0 commit comments

Comments
 (0)