Skip to content

Commit 4f399da

Browse files
committed
feat: Update fs import to use promises and refactor initSteps to async
1 parent e0d56de commit 4f399da

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/initialization.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import consola from "consola"
2-
import fs from "node:fs"
2+
import fs from "node:fs/promises"
33
import { FetchError } from "ofetch"
44

55
import { APP_CONFIG } from "~/lib/config"
@@ -22,10 +22,10 @@ interface InitStep {
2222
const initSteps: Array<InitStep> = [
2323
{
2424
name: "App directory",
25-
run: () => {
26-
if (!fs.existsSync(PATHS.APP_DIR)) {
27-
fs.mkdirSync(PATHS.APP_DIR, { recursive: true })
28-
}
25+
run: async () => {
26+
await fs.mkdir(PATHS.APP_DIR, { recursive: true })
27+
const handle = await fs.open(PATHS.GITHUB_TOKEN_PATH, "a")
28+
await handle.close()
2929
},
3030
},
3131
{

0 commit comments

Comments
 (0)