Create the home directory if it doesn't exist.

This commit is contained in:
David Hill 2013-11-19 16:40:20 -05:00
parent c2bec24f51
commit 35eea401e1

View file

@ -186,6 +186,13 @@ func loadConfig() (*config, []string, error) {
RPCCert: defaultRPCCertFile,
}
// Create the home directory if it doesn't already exist.
err := os.MkdirAll(btcdHomeDir, 0700)
if err != nil {
log.Errorf("%v", err)
os.Exit(-1)
}
// Pre-parse the command line options to see if an alternative config
// file or the version flag was specified. Any errors can be ignored
// here since they will be caught be the final parse below.