From 0ecb3d9aa5c781f4192b115d869f26ead1b46a17 Mon Sep 17 00:00:00 2001 From: "Seraphim R. Pardee" Date: Sat, 21 Sep 2024 00:34:34 -0400 Subject: [PATCH] use zip instead of tar.gz --- entrypoint.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/entrypoint.go b/entrypoint.go index bdc3aff..5844499 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -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 { // 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 - tarOptions := append([]string{"-cvzf", gzFileName}, includeFiles...) + // command-line options for the `zip` command + zipOptions := append([]string{zipFileName}, includeFiles...) - // generate `tar` command - tarCmd := exec.Command("tar", tarOptions...) + // generate `zip` command + zipCmd := exec.Command("zip", zipOptions...) // set working directory for the command - tarCmd.Dir = destDirPath + zipCmd.Dir = destDirPath - // execute `tar` command - fmt.Println("Compressing build file using:", tarCmd.String()) - if err := tarCmd.Run(); err != nil { + // execute `zip` command + fmt.Println("Compressing build file using:", zipCmd.String()) + if err := zipCmd.Run(); err != nil { fmt.Println("An error occurred during compression:", err) os.Exit(1) }