diff options
| author | Christine Dodrill <me@christine.website> | 2019-02-17 09:35:25 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-02-17 09:35:25 -0800 |
| commit | 2511992a18cf4a425aacbdd4d84449ae81b2dbc3 (patch) | |
| tree | 9c8243cabe67f8c3e4e9db7dab247e790ddf8fcb /internal/gluaexpect | |
| parent | 60d342478afe343cd36af5fb89a8569ced0e896e (diff) | |
| download | x-2511992a18cf4a425aacbdd4d84449ae81b2dbc3.tar.xz x-2511992a18cf4a425aacbdd4d84449ae81b2dbc3.zip | |
kill glue
Diffstat (limited to 'internal/gluaexpect')
| -rw-r--r-- | internal/gluaexpect/expect.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/internal/gluaexpect/expect.go b/internal/gluaexpect/expect.go deleted file mode 100644 index b7e57d4..0000000 --- a/internal/gluaexpect/expect.go +++ /dev/null @@ -1,35 +0,0 @@ -package gluaexpect - -import ( - "github.com/ThomasRooney/gexpect" - luar "github.com/layeh/gopher-luar" - lua "github.com/yuin/gopher-lua" -) - -func Preload(L *lua.LState) { - L.PreloadModule("expect", Loader) -} - -// Loader is the module loader function. -func Loader(L *lua.LState) int { - mod := L.SetFuncs(L.NewTable(), api) - L.Push(mod) - return 1 -} - -var api = map[string]lua.LGFunction{ - "spawn": spawn, -} - -func spawn(L *lua.LState) int { - cmd := L.CheckString(1) - child, err := gexpect.Spawn(cmd) - if err != nil { - L.Push(lua.LNil) - L.Push(lua.LString(err.Error())) - return 2 - } - - L.Push(luar.New(L, child)) - return 1 -} |
