feat(pockethost): gobot verbosity

This commit is contained in:
Ben Allfree 2024-07-31 04:30:34 -04:00
parent 7d5f82b465
commit d2b5f21e9d

View File

@ -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),
})
},
}
})