From eaaf17a7928dd1177ffe2019b0b7abc0b3c18a3a Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 6 Dec 2021 16:32:34 -0400 Subject: [PATCH] fix: make table for `args` instead of using luar --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0b58ad7..11113a3 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,6 @@ import ( "github.com/pborman/getopt" "github.com/yuin/gopher-lua" "golang.org/x/term" - "layeh.com/gopher-luar" ) var ( @@ -156,7 +155,12 @@ func main() { } if getopt.NArgs() > 0 { - l.SetGlobal("args", luar.New(l, getopt.Args())) + luaArgs := l.NewTable() + for _, arg := range getopt.Args() { + luaArgs.Append(lua.LString(arg)) + } + + l.SetGlobal("args", luaArgs) err := l.DoFile(getopt.Arg(0)) if err != nil { fmt.Fprintln(os.Stderr, err)