|
@ -8,18 +8,27 @@ import ( |
|
|
"PackageManager/Client/Filesystem" |
|
|
"PackageManager/Client/Filesystem" |
|
|
"PackageManager/Client/Package" |
|
|
"PackageManager/Client/Package" |
|
|
"PackageManager/Color" |
|
|
"PackageManager/Color" |
|
|
|
|
|
"PackageManager/Helper" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
|
var ( |
|
|
var ( |
|
|
updateFilesytemFlag bool |
|
|
|
|
|
updateFilesytemFlagLong bool |
|
|
|
|
|
createPackageFlag bool |
|
|
|
|
|
createPackageFlagLong bool |
|
|
|
|
|
|
|
|
updateFilesytemFlag bool |
|
|
|
|
|
updateFilesytemFlagLong bool |
|
|
|
|
|
createPackageFlag bool |
|
|
|
|
|
createPackageFlagLong bool |
|
|
|
|
|
installLocalPackageFlag bool |
|
|
|
|
|
installLocalPackageFlagLong bool |
|
|
|
|
|
|
|
|
e error |
|
|
e error |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
e = Helper.CheckRoot() |
|
|
|
|
|
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) |
|
@ -27,10 +36,13 @@ func main() { |
|
|
|
|
|
|
|
|
// Initialise flags
|
|
|
// Initialise flags
|
|
|
flag.BoolVar(&updateFilesytemFlag, "Uf", false, "Update filesystem database") |
|
|
flag.BoolVar(&updateFilesytemFlag, "Uf", false, "Update filesystem database") |
|
|
flag.BoolVar(&updateFilesytemFlagLong, "update-filesystem", false, "Update filesystem database") |
|
|
|
|
|
|
|
|
flag.BoolVar(&updateFilesytemFlagLong, "-update-filesystem", false, "Update filesystem database") |
|
|
|
|
|
|
|
|
flag.BoolVar(&createPackageFlag, "Cp", false, "Create package") |
|
|
flag.BoolVar(&createPackageFlag, "Cp", false, "Create package") |
|
|
flag.BoolVar(&createPackageFlagLong, "create-package", false, "Create Package") |
|
|
|
|
|
|
|
|
flag.BoolVar(&createPackageFlagLong, "-create-package", false, "Create Package") |
|
|
|
|
|
|
|
|
|
|
|
flag.BoolVar(&installLocalPackageFlag, "Il", false, "Install local package") |
|
|
|
|
|
flag.BoolVar(&installLocalPackageFlagLong, "-install-local-package", false, "Install local Package") |
|
|
|
|
|
|
|
|
flag.Parse() |
|
|
flag.Parse() |
|
|
|
|
|
|
|
@ -51,6 +63,14 @@ func main() { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if installLocalPackageFlag || installLocalPackageFlagLong { |
|
|
|
|
|
e = Package.InstallPackage(flag.Args()) |
|
|
|
|
|
if e != nil { |
|
|
|
|
|
panic(e) |
|
|
|
|
|
} |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
flag.Usage() |
|
|
flag.Usage() |
|
|
fmt.Println(Color.Fatal("Nothing to do")) |
|
|
fmt.Println(Color.Fatal("Nothing to do")) |
|
|
|
|
|
|
|
|