Send failed process status if knip fails
Signed-off-by: Ilya Savich <isavich@box.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/repo-tools': minor
|
||||
---
|
||||
|
||||
Fix knip-report command to send 1 exit status in case of fail
|
||||
@@ -178,5 +178,7 @@ export async function runKnipReports({
|
||||
const fullDir = cliPaths.resolveTargetRoot(packageDir);
|
||||
cleanKnipConfig({ packageDir: fullDir });
|
||||
});
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,14 @@ export const buildKnipReports = async (paths: string[] = [], opts: Options) => {
|
||||
|
||||
if (selectedPackageDirs.length > 0) {
|
||||
console.log('# Generating package knip reports');
|
||||
await runKnipReports({
|
||||
packageDirs: selectedPackageDirs,
|
||||
isLocalBuild: !isCiBuild,
|
||||
});
|
||||
|
||||
try {
|
||||
await runKnipReports({
|
||||
packageDirs: selectedPackageDirs,
|
||||
isLocalBuild: !isCiBuild,
|
||||
});
|
||||
} catch (e) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user