From 15d63c9b18e8164ab1fd3aa14c4e1f5e31ff103f Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 31 Aug 2023 09:34:14 -0500 Subject: [PATCH] test: ensure log path exists --- src/base.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)