Add zip command
This commit is contained in:
parent
07b69bfd28
commit
1a2ca2fbf8
20
magefile.go
20
magefile.go
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue