From 35eea401e181ee78018f7d2cae0e4d822861cd00 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 19 Nov 2013 16:40:20 -0500 Subject: [PATCH] Create the home directory if it doesn't exist. --- config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.go b/config.go index d289f671..202c62cc 100644 --- a/config.go +++ b/config.go @@ -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.