From 209d4fff5eeca27768ef5fba96512408d2817cc4 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Sat, 3 Feb 2018 04:55:23 -0800 Subject: [PATCH] fix: fixed parent module path --- src/command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command.ts b/src/command.ts index 4f80cbb8..289dd36a 100644 --- a/src/command.ts +++ b/src/command.ts @@ -80,7 +80,7 @@ export default abstract class Command { protected debug: (...args: any[]) => void constructor(public argv: string[], options: Config.Options) { - this.config = Config.load(options || module.parent && module.parent.filename || __dirname) + this.config = Config.load(options || module.parent && module.parent.parent && module.parent.parent.filename || __dirname) this.debug = require('debug')(this.ctor.id ? `${this.config.bin}:${this.ctor.id}` : this.config.bin) this.debug('init version: %s argv: %o', this.ctor._base, argv) cli.config.context.command = _.compact([this.ctor.id, ...argv]).join(' ')