Skip to content

Commit da224ff

Browse files
committed
chore: set exitCode to 1 before running the logic
1 parent a1f232a commit da224ff

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

build-tests/rush-redis-cobuild-plugin-integration-test/src/testLockProvider.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ async function main(): Promise<void> {
4343
console.log('Completed state: ', completedState);
4444
await lockProvider.disconnectAsync();
4545
}
46-
main().catch((err) => {
47-
console.error(err);
48-
process.exit(1);
49-
});
46+
47+
process.exitCode = 1;
48+
49+
main()
50+
.then(() => {
51+
process.exitCode = 0;
52+
})
53+
.catch((err) => {
54+
console.error(err);
55+
})
56+
.finally(() => {
57+
if (process.exitCode !== undefined) {
58+
process.exit(process.exitCode);
59+
}
60+
});

0 commit comments

Comments
 (0)