-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docz-core): ensure dir for promise logger
- Loading branch information
1 parent
0b5ace2
commit 6240f21
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import * as path from 'path' | ||
import * as fs from 'fs-extra' | ||
import createLogger from 'progress-estimator' | ||
import * as paths from '../config/paths' | ||
|
||
export const promiseLogger = createLogger({ | ||
storagePath: path.join(paths.cache, '.progress-estimator'), | ||
}) | ||
const CACHE_DIR = path.join(paths.cache, '.progress-estimator') | ||
|
||
export const promiseLogger = async (...args: any[]) => { | ||
await fs.ensureDir(CACHE_DIR) | ||
return createLogger({ | ||
storagePath: path.join(paths.cache, '.progress-estimator'), | ||
})(...args) | ||
} |