Skip to content

Commit b3647a2

Browse files
committed
feat: Add business account support to auth
1 parent 6c292d3 commit b3647a2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/auth.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
import { defineCommand } from "citty"
44
import consola from "consola"
55

6-
import { PATHS } from "./lib/paths"
6+
import { ensurePaths, PATHS } from "./lib/paths"
7+
import { state } from "./lib/state"
78
import { setupGitHubToken } from "./lib/token"
9+
import { cacheVSCodeVersion } from "./lib/vscode-version"
810

911
interface RunAuthOptions {
1012
verbose: boolean
13+
business: boolean
1114
}
1215

1316
export async function runAuth(options: RunAuthOptions): Promise<void> {
@@ -16,6 +19,14 @@ export async function runAuth(options: RunAuthOptions): Promise<void> {
1619
consola.info("Verbose logging enabled")
1720
}
1821

22+
if (options.business) {
23+
state.accountType = "business"
24+
consola.info("Using business plan GitHub account")
25+
}
26+
27+
await ensurePaths()
28+
await cacheVSCodeVersion()
29+
1930
await setupGitHubToken({ force: true })
2031
consola.success("GitHub token written to", PATHS.GITHUB_TOKEN_PATH)
2132
}
@@ -32,10 +43,16 @@ export const auth = defineCommand({
3243
default: false,
3344
description: "Enable verbose logging",
3445
},
46+
business: {
47+
type: "boolean",
48+
default: false,
49+
description: "Use a business plan GitHub Account",
50+
},
3551
},
3652
run({ args }) {
3753
return runAuth({
3854
verbose: args.verbose,
55+
business: args.business,
3956
})
4057
},
4158
})

0 commit comments

Comments
 (0)