refactor(init) check file after
Brian Tiger Chow committed
Nov 4, 2014 at 03:38 UTC
3c8657503c0448221a095141703d29f8de6af4dd
1 file changed
+1
-1
cmd/ipfs2/init.go
+1
-1
@@ -50,12 +50,12 @@ func foo(res cmds.Response, req cmds.Request) error {
50
return errors.New("failed to parse datastore flag")
51
}
52
53
- fi, err := os.Lstat(filename)
53
arg, found = req.Option("f")
54
force, ok := arg.(bool)
55
if found && !ok {
56
return errors.New("failed to parse force flag")
57
}
58
+ fi, err := os.Lstat(filename)
59
if fi != nil || (err != nil && !os.IsNotExist(err)) {
60
if !force {
61
// TODO multi-line string