diff --git a/src/base.ts b/src/base.ts index 48522c75..6472b29b 100644 --- a/src/base.ts +++ b/src/base.ts @@ -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 { @@ -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)