Compare commits

..

No commits in common. "062f40e9e51baabff8d7a17884a332445edce68d" and "52379dbdd728419e115b556d7fda2500a8a2922d" have entirely different histories.

3 changed files with 0 additions and 20 deletions

15
api.go
View File

@ -30,7 +30,6 @@ var exports = map[string]lua.LGFunction {
"read": hlread, "read": hlread,
"run": hlrun, "run": hlrun,
"timeout": hltimeout, "timeout": hltimeout,
"which": hlwhich,
} }
var greeting string var greeting string
@ -332,17 +331,3 @@ func hlprependPath(L *lua.LState) int {
return 0 return 0
} }
// which(binName)
// Searches for an executable called `binName` in the directories of $PATH
func hlwhich(L *lua.LState) int {
binName := L.CheckString(1)
path, err := exec.LookPath(binName)
if err != nil {
l.Push(lua.LNil)
return 1
}
l.Push(lua.LString(path))
return 1
}

View File

@ -35,5 +35,3 @@ run(cmd) > Runs `cmd` in Hilbish's sh interpreter.
timeout(cb, time) > Runs the `cb` function after `time` in milliseconds timeout(cb, time) > Runs the `cb` function after `time` in milliseconds
which(binName) > Searches for an executable called `binName` in the directories of $PATH

View File

@ -65,7 +65,4 @@ function hilbish.run(cmd) end
--- @param time number --- @param time number
function hilbish.timeout(cb, time) end function hilbish.timeout(cb, time) end
--- Searches for an executable called `binName` in the directories of $PATH
function hilbish.which() end
return hilbish return hilbish