Data update

This commit is contained in:
Ingy döt Net 2025-02-27 18:35:13 -05:00
parent 8e4e15fa56
commit 72eb4943cb
1853 changed files with 35514 additions and 9441 deletions

View file

@ -1,6 +0,0 @@
/* Get_system_command_output.wren */
class Command {
foreign static output(name, param) // the code for this is provided by Go
}
System.print(Command.output("ls", "-ls"))

View file

@ -1,39 +0,0 @@
/* Get_system_command_output.go */
package main
import (
wren "github.com/crazyinfin8/WrenGo"
"log"
"os"
"os/exec"
)
type any = interface{}
func getCommandOutput(vm *wren.VM, parameters []any) (any, error) {
name := parameters[1].(string)
param := parameters[2].(string)
var cmd *exec.Cmd
if param != "" {
cmd = exec.Command(name, param)
} else {
cmd = exec.Command(name)
}
cmd.Stderr = os.Stderr
bytes, err := cmd.Output()
if err != nil {
log.Fatal(err)
}
return string(bytes), nil
}
func main() {
vm := wren.NewVM()
fileName := "Get_system_command_output.wren"
methodMap := wren.MethodMap{"static output(_,_)": getCommandOutput}
classMap := wren.ClassMap{"Command": wren.NewClass(nil, nil, methodMap)}
module := wren.NewModule(classMap)
vm.SetModule(fileName, module)
vm.InterpretFile(fileName)
vm.Free()
}

View file

@ -0,0 +1,3 @@
import "os" for Process
System.print(Process.read("ls", ["-ls"]))