From 24d0b8ead7e3f6650ab41dc48ff360d3a0ae6615 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:13:56 -0400 Subject: [PATCH] fix: set hilbish.exitCode to last command exit code --- exec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.go b/exec.go index 1ead1df..ff4ace2 100644 --- a/exec.go +++ b/exec.go @@ -14,7 +14,7 @@ import ( "syscall" "time" -// "hilbish/util" + "hilbish/util" rt "github.com/arnodel/golua/runtime" "mvdan.cc/sh/v3/shell" @@ -437,7 +437,7 @@ func cmdFinish(code uint8, cmdstr string, private bool) { if interactive && !private { handleHistory(cmdstr) } -// util.SetField(l, hshMod, "exitCode", lua.LNumber(code), "Exit code of last exected command") + util.SetField(l, hshMod, "exitCode", rt.IntValue(int64(code)), "Exit code of last exected command") // using AsValue (to convert to lua type) on an interface which is an int // results in it being unknown in lua .... ???? // so we allow the hook handler to take lua runtime Values