Don't create .dcrd willy-nilly.

This interferes with the installer when it tries to detect if the
required .dirs already exist or not.

Debated with jrick and ay-p.
This commit is contained in:
Marco Peereboom 2016-06-08 16:55:40 -05:00
parent 2bbfd5f250
commit fa72e214db

View File

@ -176,20 +176,13 @@ func loadConfig() (*config, []string, error) {
RPCCert: defaultRPCCertFile,
}
// Create the home directory if it doesn't already exist.
err := os.MkdirAll(dcrdHomeDir, 0700)
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(-1)
}
// Pre-parse the command line options to see if an alternative config
// file, the version flag, or the list commands flag was specified. Any
// errors aside from the help message error can be ignored here since
// they will be caught by the final parse below.
preCfg := cfg
preParser := flags.NewParser(&preCfg, flags.HelpFlag)
_, err = preParser.Parse()
_, err := preParser.Parse()
if err != nil {
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
fmt.Fprintln(os.Stderr, err)