aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil/config.go')
-rw-r--r--ethutil/config.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/ethutil/config.go b/ethutil/config.go
index df1772d81..70553fb5b 100644
--- a/ethutil/config.go
+++ b/ethutil/config.go
@@ -34,12 +34,14 @@ func ReadConfig(base string) *config {
usr, _ := user.Current()
path := path.Join(usr.HomeDir, base)
- //Check if the logging directory already exists, create it if not
- _, err := os.Stat(path)
- if err != nil {
- if os.IsNotExist(err) {
- log.Printf("Debug logging directory %s doesn't exist, creating it", path)
- os.Mkdir(path, 0777)
+ if len(base) > 0 {
+ //Check if the logging directory already exists, create it if not
+ _, err := os.Stat(path)
+ if err != nil {
+ if os.IsNotExist(err) {
+ log.Printf("Debug logging directory %s doesn't exist, creating it", path)
+ os.Mkdir(path, 0777)
+ }
}
}