@cryptotaxi247 / kubo / commits / a1e738e29

docs(init) rename filename var

Brian Tiger Chow committed Nov 4, 2014 at 04:03 UTC a1e738e297e2f477b53d94aa5c8ca6e9e2ea954b
1 file changed +5 -4
cmd/ipfs2/init.go
+5 -4
@@ -62,12 +62,13 @@ var initCmd = &cmds.Command{
62 func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) error {
63
64 u.POut("initializing ipfs node at %s\n", configRoot)
65 - filename, err := config.Filename(configRoot)
65 +
66 + configFilename, err := config.Filename(configRoot)
67 if err != nil {
68 return errors.New("Couldn't get home directory path")
69 }
70
70 - fi, err := os.Lstat(filename)
71 + fi, err := os.Lstat(configFilename)
72 if fi != nil || (err != nil && !os.IsNotExist(err)) {
73 if !force {
74 // TODO multi-line string
@@ -112,7 +113,7 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
113 IPNS: "/ipns",
114 }
115
115 - // TODO guard
116 + // TODO guard higher up
117 if nBitsForKeypair < 1024 {
118 return errors.New("Bitsize less than 1024 is considered unsafe.")
119 }
@@ -152,7 +153,7 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
153 Current: updates.Version,
154 }
155
155 - err = config.WriteConfigFile(filename, cfg)
156 + err = config.WriteConfigFile(configFilename, cfg)
157 if err != nil {
158 return err
159 }