From 8d17ebc0bbe08b07d463cf7d199d7ffc20496e90 Mon Sep 17 00:00:00 2001 From: Ryan Kophs Date: Thu, 15 May 2025 11:59:02 -0400 Subject: [PATCH] use fs/promise --- src/lib/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index a0a2e34..d5c3286 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -314,8 +314,8 @@ export function setupOAuthCallbackServerWithLongPoll(options: OAuthCallbackServe Authorization successful! You may close this window and return to the CLI. @@ -431,7 +431,7 @@ export async function parseCommandLineArgs(args: string[], usage: string) { } else if (args[i] === '--headerFile' && i < args.length - 1) { const filePath = args[i + 1] try { - const fileContent = fs.readFileSync(filePath, 'utf8') + const fileContent = await fs.readFile(filePath, 'utf8') const lines = fileContent.split('\n') for (const line of lines) { const trimmedLine = line.trim() @@ -446,7 +446,7 @@ export async function parseCommandLineArgs(args: string[], usage: string) { } log(`Loaded headers from file: ${filePath}`) } catch (error) { - log(`Error reading header file ${filePath}: ${error.message}`) + log(`Error reading header file ${filePath}: ${error}`) } args.splice(i, 2) // Do not increment i, as the array has shifted