Merge pull request #9482 from daviddyball/master
scaffolder-backend: fix error behaviour in runCommand helper
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Fix error handling of the `runCommand` helper to return `Error`
|
||||
instance.
|
||||
@@ -58,7 +58,9 @@ export const runCommand = async ({
|
||||
|
||||
process.on('close', code => {
|
||||
if (code !== 0) {
|
||||
return reject(`Command ${command} failed, exit code: ${code}`);
|
||||
return reject(
|
||||
new Error(`Command ${command} failed, exit code: ${code}`),
|
||||
);
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user