|
@ -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) |
|
|