Skip to content

Commit

Permalink
fix(docz-core): ensure dir for promise logger
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Dec 17, 2018
1 parent 0b5ace2 commit 6240f21
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/docz-core/src/utils/promise-logger.ts
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)
}

0 comments on commit 6240f21

Please sign in to comment.