提交 d37c758f 编写于 作者: J jaslin

fix #70 ,it maybe cause by designing the ConfigSetting as an interface, work...

fix #70 ,it maybe cause by designing the ConfigSetting as an interface, work around it putting the _puppetinstace in to global
上级 8941ca2f
...@@ -138,20 +138,20 @@ function puppetInstance(instance: Puppet): void ...@@ -138,20 +138,20 @@ function puppetInstance(instance: Puppet): void
function puppetInstance(instance?: Puppet | null): Puppet | void { function puppetInstance(instance?: Puppet | null): Puppet | void {
if (instance === undefined) { if (instance === undefined) {
if (!Config._puppetInstance) { if (!global['_puppetInstance']) {
throw new Error('no puppet instance') throw new Error('no puppet instance')
} }
return Config._puppetInstance return global['_puppetInstance']
} else if (instance === null) { } else if (instance === null) {
log.verbose('Config', 'puppetInstance(null)') log.verbose('Config', 'puppetInstance(null)')
Config._puppetInstance = null global['_puppetInstance'] = null
return return
} }
log.verbose('Config', 'puppetInstance(%s)', instance.constructor.name) log.verbose('Config', 'puppetInstance(%s)', instance.constructor.name)
Config._puppetInstance = instance global['_puppetInstance'] = instance
return return
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册