Commit 068c0375 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

bugfix: get to root cmd for config flag

parent 7bf7afb7
......@@ -149,7 +149,11 @@ type cmdContext struct {
// setupCmdContext initializes a cmdContext structure from a given command.
func setupCmdContext(c *commander.Command, online bool) (cc cmdContext, err error) {
cc.configDir, err = getConfigDir(c.Parent.Parent)
rootCmd := c
for ; rootCmd.Parent != nil; rootCmd = c.Parent {
}
cc.configDir, err = getConfigDir(rootCmd)
if err != nil {
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment