File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import consola from "consola"
2- import fs from "node:fs/promises"
32import { FetchError } from "ofetch"
43
5- import { PATHS } from "~/lib/paths"
4+ import { ensurePaths } from "~/lib/paths"
65import { tokenService } from "~/lib/token"
76import { getGitHubUser } from "~/services/github/get-user/service"
87
98import { getModels } from "../services/copilot/get-models/service"
109import { getGitHubToken } from "../services/github/get-token/service"
1110
12- async function initializeAppDirectory ( ) : Promise < void > {
13- await fs . mkdir ( PATHS . APP_DIR , { recursive : true } )
14- try {
15- await fs . access ( PATHS . GITHUB_TOKEN_PATH , fs . constants . W_OK )
16- } catch {
17- await fs . writeFile ( PATHS . GITHUB_TOKEN_PATH , "" )
18- await fs . chmod ( PATHS . GITHUB_TOKEN_PATH , 0o600 )
19- }
20- }
21-
2211async function initializeGithubAuthentication ( ) : Promise < void > {
2312 const githubToken = await tokenService . getGithubToken ( )
2413
@@ -71,7 +60,7 @@ async function logUser() {
7160}
7261
7362export async function initializeApp ( ) {
74- await initializeAppDirectory ( )
63+ await ensurePaths ( )
7564 await initializeGithubAuthentication ( )
7665 await initializeCopilotToken ( )
7766 await logModelInformation ( )
Original file line number Diff line number Diff line change @@ -4,14 +4,12 @@ export default defineConfig({
44 entry : [ "src/main.ts" ] ,
55
66 format : [ "esm" ] ,
7- target : "esnext " ,
7+ target : "es2022 " ,
88 platform : "node" ,
99
10- dts : true ,
11- removeNodeProtocol : false ,
12- sourcemap : true ,
13- shims : true ,
10+ minify : true ,
1411 clean : true ,
12+ removeNodeProtocol : false ,
1513
1614 env : {
1715 NODE_ENV : "production" ,
You can’t perform that action at this time.
0 commit comments