This repository has been archived by the owner on Apr 24, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: UnhandledPromiseRejectionWarning: TypeError: execa.shellSync is …
…not a function #95
- Loading branch information
1 parent
2c16655
commit b8e8b0a
Showing
4 changed files
with
1,259 additions
and
1,295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const crossSpawn = require('cross-spawn') | ||
|
||
module.exports.spawnSync = function (cmd, params, opts, onFail) { | ||
console.log(`[sync] Running "${cmd} ${params.join(' ')}"\n`) | ||
|
||
const runner = crossSpawn.sync( | ||
cmd, | ||
params, | ||
{ stdio: 'inherit', stdout: 'inherit', stderr: 'inherit', ...opts } | ||
) | ||
|
||
if (runner.status || runner.error) { | ||
console.log() | ||
console.error(`⚠️ Command "${cmd}" failed with exit code: ${runner.status}`) | ||
if (runner.status === null) { | ||
console.error(`⚠️ Please globally install "${cmd}"`) | ||
} | ||
onFail && onFail() | ||
} | ||
} |
Oops, something went wrong.