bugfix: get to root cmd for config flag
Juan Batiz-Benet committed
Oct 2, 2014 at 03:05 UTC
068c0375f9929e69fafd1589e8db40ba54ed944f
1 file changed
+5
-1
cmd/ipfs/ipfs.go
+5
-1
@@ -149,7 +149,11 @@ type cmdContext struct {
149
150
// setupCmdContext initializes a cmdContext structure from a given command.
151
func setupCmdContext(c *commander.Command, online bool) (cc cmdContext, err error) {
152
- cc.configDir, err = getConfigDir(c.Parent.Parent)
152
+ rootCmd := c
153
+ for ; rootCmd.Parent != nil; rootCmd = c.Parent {
154
+ }
155
+
156
+ cc.configDir, err = getConfigDir(rootCmd)
157
if err != nil {
158
return
159
}