danger: ignore known git show error
This commit is contained in:
parent
9348940ecf
commit
8fe51cc854
1 changed files with 16 additions and 1 deletions
|
@ -6,4 +6,19 @@ import { run } from 'endanger';
|
||||||
import migrateBackboneToRedux from './rules/migrateBackboneToRedux';
|
import migrateBackboneToRedux from './rules/migrateBackboneToRedux';
|
||||||
import packageJsonVersionsShouldBePinned from './rules/packageJsonVersionsShouldBePinned';
|
import packageJsonVersionsShouldBePinned from './rules/packageJsonVersionsShouldBePinned';
|
||||||
|
|
||||||
run(migrateBackboneToRedux(), packageJsonVersionsShouldBePinned());
|
function isGitDeletedError(error: unknown) {
|
||||||
|
return (
|
||||||
|
typeof error === 'object' &&
|
||||||
|
error != null &&
|
||||||
|
error['code'] === 128 &&
|
||||||
|
error['command']?.startsWith('git show ')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
run(migrateBackboneToRedux(), packageJsonVersionsShouldBePinned());
|
||||||
|
} catch (error: unknown) {
|
||||||
|
if (!isGitDeletedError(error)) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue