mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
feat(pockethost): gobot verbosity
This commit is contained in:
parent
7d5f82b465
commit
d2b5f21e9d
@ -1,10 +1,19 @@
|
||||
import { default as env } from 'env-var'
|
||||
import { GobotOptions, gobot } from 'gobot'
|
||||
import { mkSingleton } from '../common'
|
||||
import { PH_GOBOT_ROOT } from '../constants'
|
||||
|
||||
export const PH_GOBOT_VERBOSITY = () =>
|
||||
env.get(`PH_GOBOT_VERBOSITY`).default(1).asIntPositive()
|
||||
|
||||
export const GobotService = mkSingleton(() => {
|
||||
return {
|
||||
gobot: (name: string, options?: Partial<GobotOptions>) =>
|
||||
gobot(name, { ...options, cachePath: PH_GOBOT_ROOT(`cache`, name) }),
|
||||
gobot: (name: string, options?: Partial<GobotOptions>) => {
|
||||
// verbosity(PH_GOBOT_VERBOSITY())
|
||||
return gobot(name, {
|
||||
...options,
|
||||
cachePath: PH_GOBOT_ROOT(`cache`, name),
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user