animeic-cd 1 year ago
parent
commit
cb80880464
1 changed files with 6 additions and 1 deletions
  1. 6 1
      main.go

+ 6 - 1
main.go

@@ -33,7 +33,12 @@ func main() {
 	// utils.Unzip(zipPath,filepath.Base(zipFile),nil)
 	GAppOption.Parse()
 	if len(GAppOption.Unzip) > 0 {
-		dest := fmt.Sprintf("output/%s", filepath.Base(GAppOption.Unzip))
+		fileName := filepath.Base(GAppOption.Unzip)
+		ext := filepath.Ext(fileName)
+		fileDir := strings.TrimSuffix(fileName, ext)
+		fmt.Println(GAppOption.Unzip)
+		dest := fmt.Sprintf("%s/%s", filepath.Dir(GAppOption.Unzip), fileDir)
+		fmt.Println("unzip dir:", dest)
 		err := utils.Unzip(GAppOption.Unzip, dest, nil)
 		if err != nil {
 			fmt.Println("unzip err:", err)