Explorar el Código

Fixes #373

Signed-off-by: Jguer <me@jguer.space>
Jguer hace 7 años
padre
commit
58772c871b
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      main.go

+ 8 - 0
main.go

@@ -60,6 +60,14 @@ func initConfig() (err error) {
 					err)
 				defaultSettings(&config)
 			}
+			if _, err = os.Stat(config.BuildDir); os.IsNotExist(err) {
+				err = os.MkdirAll(config.BuildDir, 0755)
+				if err != nil {
+					err = fmt.Errorf("Unable to create BuildDir directory:\n%s\n"+
+						"The error was:\n%s", config.BuildDir, err)
+					return
+				}
+			}
 		}
 	}