Skip to content

Commit d4213da

Browse files
authored
fix: Optimize script library scripts and execution methods (#8262)
1 parent 220b622 commit d4213da

13 files changed

Lines changed: 145 additions & 542 deletions

File tree

core/app/api/v2/script_library.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ func (b *BaseApi) RunScript(c *gin.Context) {
147147
fileName := strings.ReplaceAll(scriptItem.Name, " ", "_")
148148
quitChan := make(chan bool, 3)
149149
if currentNode == "local" {
150-
tmpFile := path.Join(global.CONF.Base.InstallDir, "1panel/tmp/script")
151-
initCmd := fmt.Sprintf("d=%s && mkdir -p $d && echo %s > $d/%s && clear && bash $d/%s", tmpFile, scriptItem.Script, fileName, fileName)
152-
slave, err := terminal.NewCommand(initCmd)
150+
slave, err := terminal.NewCommand(scriptItem.Script)
153151
if wshandleError(wsConn, err) {
154152
return
155153
}

0 commit comments

Comments
 (0)