use fs/promise
This commit is contained in:
parent
40a9f30755
commit
8d17ebc0bb
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue