Skip to content

Commit

Permalink
test: ensure log path exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 31, 2023
1 parent 22e1c4c commit 15d63c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Command} from '@oclif/core'
import {openSync, writeSync} from 'fs'
import {openSync, writeSync, mkdirSync} from 'fs'
import * as path from 'path'

export abstract class AutocompleteBase extends Command {
Expand Down Expand Up @@ -30,6 +30,7 @@ export abstract class AutocompleteBase extends Command {
}

writeLogFile(msg: string) {
mkdirSync(this.config.cacheDir, {recursive: true})
const entry = `[${(new Date()).toISOString()}] ${msg}\n`
const fd = openSync(this.acLogfilePath, 'a')
writeSync(fd, entry)
Expand Down

0 comments on commit 15d63c9

Please sign in to comment.