Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 6240f21

Browse files
committed
fix(docz-core): ensure dir for promise logger
1 parent 0b5ace2 commit 6240f21

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import * as path from 'path'
2+
import * as fs from 'fs-extra'
23
import createLogger from 'progress-estimator'
34
import * as paths from '../config/paths'
45

5-
export const promiseLogger = createLogger({
6-
storagePath: path.join(paths.cache, '.progress-estimator'),
7-
})
6+
const CACHE_DIR = path.join(paths.cache, '.progress-estimator')
7+
8+
export const promiseLogger = async (...args: any[]) => {
9+
await fs.ensureDir(CACHE_DIR)
10+
return createLogger({
11+
storagePath: path.join(paths.cache, '.progress-estimator'),
12+
})(...args)
13+
}

0 commit comments

Comments
 (0)