Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Improve error message when running manifest commands (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread authored May 31, 2021
1 parent 003cf79 commit 983cdd2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dev/manifest-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ class ManifestUtil {

_evaluateModificationCommand(data) {
const {command, args, trim} = data;
const {stdout, status} = childProcess.spawnSync(command, args, {
const {stdout, stderr, status} = childProcess.spawnSync(command, args, {
cwd: __dirname,
stdio: 'pipe',
shell: false
});
if (status !== 0) {
throw new Error(`Failed to execute ${command} ${args.join(' ')}`);
const message = stderr.toString('utf8').trim();
throw new Error(`Failed to execute ${command} ${args.join(' ')}\nstatus=${status}\n${message}`);
}
let result = stdout.toString('utf8');
if (trim) { result = result.trim(); }
Expand Down

0 comments on commit 983cdd2

Please sign in to comment.