Skip to content

Commit

Permalink
warning
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Jul 10, 2019
1 parent 7b3e818 commit 915e376
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,24 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// first, whether user has provided the initialization flag. we may be
// running in an uninitialized state.
initialize, _ := req.Options[initOptionKwd].(bool)
if initialize && !fsrepo.IsInitialized(cctx.ConfigRoot) {
cfgLocation, _ := req.Options[initConfigOptionKwd].(string)
profiles, _ := req.Options[initProfileOptionKwd].(string)
var conf *config.Config
if initialize {
if fsrepo.IsInitialized(cctx.ConfigRoot) {
log.Warningf("repo is already initialized, nothing will be altered")
} else {
cfgLocation, _ := req.Options[initConfigOptionKwd].(string)
profiles, _ := req.Options[initProfileOptionKwd].(string)
var conf *config.Config

if cfgLocation != "" {
if conf, err = cserial.Load(cfgLocation); err != nil {
return err
}
}

if cfgLocation != "" {
if conf, err = cserial.Load(cfgLocation); err != nil {
if err = doInit(os.Stdout, cctx.ConfigRoot, false, nBitsForKeypairDefault, profiles, conf); err != nil {
return err
}
}

if err = doInit(os.Stdout, cctx.ConfigRoot, false, nBitsForKeypairDefault, profiles, conf); err != nil {
return err
}
}

// acquire the repo lock _before_ constructing a node. we need to make
Expand Down

0 comments on commit 915e376

Please sign in to comment.