Skip to content

Commit

Permalink
Do not error if dcrctl can't find dcrd.conf.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcvernaleo committed Sep 8, 2016
1 parent 9e2a8e1 commit ab6d355
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/dcrctl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,12 @@ func createDefaultConfigFile(destinationPath string) error {
return err
}

// Read dcrd.conf from its default path.
// Read dcrd.conf from its default path. If no dcrd.conf then just give
// up but do not error (since it is not an error to not have a dcrd.conf.
dcrdConfigPath := filepath.Join(dcrdHomeDir, "dcrd.conf")
dcrdConfigFile, err := os.Open(dcrdConfigPath)
if err != nil {
return err
return nil
}
defer dcrdConfigFile.Close()
content, err := ioutil.ReadAll(dcrdConfigFile)
Expand Down

0 comments on commit ab6d355

Please sign in to comment.