Skip to content

Commit d4d6511

Browse files
feat: changed process.exits to throw new Error()s (#652)
<!-- 👋 Hi, thanks for sending a PR to template-typescript-node-package! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #538 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Changed process.exit(1) to Throw new Error(...) in src/shared/getOctokit.ts Tried to do the same in src/shared/prompts.ts as suggested in issue comments, but felt it was better with the original process.exit(1) code
1 parent 9456765 commit d4d6511

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/shared/getOctokit.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export async function getOctokit(
2525
console.error();
2626
console.error(chalk.red((error as Error).message));
2727
console.error();
28-
// eslint-disable-next-line n/no-process-exit
29-
process.exit(1);
28+
throw new Error("GitHub authentication failed.");
3029
}
3130

3231
const auth = (await $`gh auth token`).stdout.trim();

0 commit comments

Comments
 (0)