mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-03 12:13:25 +00:00
feat: add hilbish.cwd function
This commit is contained in:
parent
ba6d7972e0
commit
af4b4b2ae0
10
hilbish.go
10
hilbish.go
@ -14,6 +14,7 @@ import (
|
|||||||
var exports = map[string]lua.LGFunction {
|
var exports = map[string]lua.LGFunction {
|
||||||
"run": run,
|
"run": run,
|
||||||
"flag": flag,
|
"flag": flag,
|
||||||
|
"cwd": cwd,
|
||||||
}
|
}
|
||||||
|
|
||||||
func HilbishLoader(L *lua.LState) int {
|
func HilbishLoader(L *lua.LState) int {
|
||||||
@ -53,3 +54,12 @@ func flag(L *lua.LState) int {
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cwd(L *lua.LState) int {
|
||||||
|
cwd, _ := os.Getwd()
|
||||||
|
|
||||||
|
L.Push(lua.LString(cwd))
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user