mirror of https://github.com/Hilbis/Hilbish
fix: set hilbish.exitCode to last command exit code
parent
dd52fd2ad9
commit
24d0b8ead7
4
exec.go
4
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
|
||||
|
|
Loading…
Reference in New Issue