use zip instead of tar.gz

This commit is contained in:
Seraphim R. Pardee 2024-09-21 00:34:34 -04:00
parent 9d340fc2d1
commit 0ecb3d9aa5

View File

@ -118,11 +118,11 @@ func build(packageName, destDir string, platform map[string]string, ldflags stri
/*------------------------------*/ /*------------------------------*/
// create a compressed `.tar.gz` file // create a compressed `.zip` file
if compress { if compress {
// compressed gzip file name // compressed gzip file name
gzFileName := fmt.Sprintf("%s-%s-%s.tar.gz", inputName, platformKernel, platformArch) zipFileName := fmt.Sprintf("%s-%s-%s", inputName, platformKernel, platformArch)
/*------------*/ /*------------*/
@ -143,18 +143,18 @@ func build(packageName, destDir string, platform map[string]string, ldflags stri
/*------------*/ /*------------*/
// command-line options for the `tar` command // command-line options for the `zip` command
tarOptions := append([]string{"-cvzf", gzFileName}, includeFiles...) zipOptions := append([]string{zipFileName}, includeFiles...)
// generate `tar` command // generate `zip` command
tarCmd := exec.Command("tar", tarOptions...) zipCmd := exec.Command("zip", zipOptions...)
// set working directory for the command // set working directory for the command
tarCmd.Dir = destDirPath zipCmd.Dir = destDirPath
// execute `tar` command // execute `zip` command
fmt.Println("Compressing build file using:", tarCmd.String()) fmt.Println("Compressing build file using:", zipCmd.String())
if err := tarCmd.Run(); err != nil { if err := zipCmd.Run(); err != nil {
fmt.Println("An error occurred during compression:", err) fmt.Println("An error occurred during compression:", err)
os.Exit(1) os.Exit(1)
} }