Kaynağa Gözat

调试功能

zou.yingbin 4 yıl önce
ebeveyn
işleme
9e00ec22e8
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      controllers/other/update.go

+ 5 - 1
controllers/other/update.go

@@ -9,6 +9,7 @@ package other
 
 import (
 	_ "embed"
+	"fmt"
 	"github.com/gin-gonic/gin"
 	"mtp2_if/logger"
 	"net/http"
@@ -49,7 +50,10 @@ func MakeUpdateScript(c *gin.Context) {
 		names := rx.FindStringSubmatch(filename)
 		// 正则表达式检查文件名是否符合规范
 		if len(names) > 0 && names[0] == filename {
-			_ = exec.Command("sh", "./update.sh", filename).Run()
+			fmt.Println("filename:", filename)
+			cmd := exec.Command("sh", "./update.sh", filename)
+			fmt.Println("cmd param:", cmd.Args)
+			cmd.Run()
 		} else {
 			_ = exec.Command("sh", "./update.sh").Run()
 		}