Browse Source

Explicitly call InitConfigDir

feature/create-install-pkgs
Tovi Jaeschke-Rogers 3 years ago
parent
commit
d45f42fe26
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      Client/main.go

+ 8
- 3
Client/main.go View File

@ -13,16 +13,15 @@ import (
"PackageManager/Variables" "PackageManager/Variables"
) )
func init() {
func InitConfigDir() error {
var ( var (
e error e error
) )
_, e = os.Stat(Variables.ConfigDir) _, e = os.Stat(Variables.ConfigDir)
if os.IsNotExist(e) { if os.IsNotExist(e) {
os.MkdirAll(Variables.ConfigDir, 0644) os.MkdirAll(Variables.ConfigDir, 0644)
} else if e != nil {
panic(e)
} }
return e
} }
func HelpMsg() { func HelpMsg() {
@ -90,6 +89,12 @@ func main() {
return return
} }
e = InitConfigDir()
if e != nil {
fmt.Println(Color.Fatal(e))
return
}
e = Database.InitDB() e = Database.InitDB()
if e != nil { if e != nil {
panic(e) panic(e)


Loading…
Cancel
Save