Skip to content

Commit 3af6eca

Browse files
Moved auth into conditional block
1 parent dda6f2b commit 3af6eca

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: script/setup.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ try {
2323
);
2424
console.log();
2525

26-
console.log(chalk.gray`Checking gh auth status...`);
27-
let auth;
28-
try {
29-
await $`gh auth status`;
30-
auth = (await $`gh auth token`).toString().trim();
31-
} catch (error) {
32-
throw new Error(error.stderr);
33-
}
34-
35-
console.log(chalk.gray`✔️ Done.`);
36-
console.log();
37-
3826
const { values } = parseArgs({
3927
args: process.argv.slice(2),
4028
options: {
@@ -172,6 +160,18 @@ try {
172160
if (skipApi) {
173161
console.log(chalk.gray`➖ Skipping API hydration.`);
174162
} else {
163+
console.log(chalk.gray`Checking gh auth status...`);
164+
let auth;
165+
try {
166+
await $`gh auth status`;
167+
auth = (await $`gh auth token`).toString().trim();
168+
} catch (error) {
169+
throw new Error(error.stderr);
170+
}
171+
172+
console.log(chalk.gray`✔️ Done.`);
173+
console.log();
174+
175175
console.log(chalk.gray`Hydrating repository labels...`);
176176

177177
const existingLabels = JSON.parse(

0 commit comments

Comments
 (0)