From 45680d7d90f62eff810bc07afba57df8db0f8bfb Mon Sep 17 00:00:00 2001 From: CMA2401PT <1634268014@qq.com> Date: Fri, 26 Jul 2024 23:19:12 +0800 Subject: [PATCH] trim execute --- oslib.go | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/oslib.go b/oslib.go index 5448cc1f..a6cbec18 100644 --- a/oslib.go +++ b/oslib.go @@ -79,23 +79,25 @@ func osDiffTime(L *LState) int { } func osExecute(L *LState) int { - var procAttr os.ProcAttr - procAttr.Files = []*os.File{os.Stdin, os.Stdout, os.Stderr} - cmd, args := popenArgs(L.CheckString(1)) - args = append([]string{cmd}, args...) - process, err := os.StartProcess(cmd, args, &procAttr) - if err != nil { - L.Push(LNumber(1)) - return 1 - } - - ps, err := process.Wait() - if err != nil || !ps.Success() { - L.Push(LNumber(1)) - return 1 - } - L.Push(LNumber(0)) - return 1 + panic("execute is not supported") + return 0 + // var procAttr os.ProcAttr + // procAttr.Files = []*os.File{os.Stdin, os.Stdout, os.Stderr} + // cmd, args := popenArgs(L.CheckString(1)) + // args = append([]string{cmd}, args...) + // process, err := os.StartProcess(cmd, args, &procAttr) + // if err != nil { + // L.Push(LNumber(1)) + // return 1 + // } + + // ps, err := process.Wait() + // if err != nil || !ps.Success() { + // L.Push(LNumber(1)) + // return 1 + // } + // L.Push(LNumber(0)) + // return 1 } func osExit(L *LState) int {