mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "062f40e9e51baabff8d7a17884a332445edce68d" and "52379dbdd728419e115b556d7fda2500a8a2922d" have entirely different histories.
062f40e9e5
...
52379dbdd7
15
api.go
15
api.go
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue