Add zip command

This commit is contained in:
kolaente 2020-09-02 22:37:56 +02:00
parent 07b69bfd28
commit 1a2ca2fbf8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 19 additions and 1 deletions

View File

@ -573,8 +573,26 @@ func (Release) OsPackage() error {
return nil
}
func (Release) Zip() {
// Creates a zip file from all os-package folders in dist/release
func (Release) Zip() error {
p := RootPath + "/" + DIST + "/release/"
if err := filepath.Walk(p, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() || info.Name() == "release" {
return nil
}
fmt.Printf("Zipping %s...\n", info.Name())
c := exec.Command("zip", "-r", RootPath+"/"+DIST+"/zip/"+info.Name(), ".", "-i", "*")
c.Dir = path
out, err := c.Output()
fmt.Print(string(out))
return err
}); err != nil {
return err
}
return nil
}
func (Release) BuildDeb() {