mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "1868715b8a7f302474c31d0c3fa5690f3734784d" and "74a6eda0f3b9813b79d75f17ac3d80b679d25cc9" have entirely different histories.
1868715b8a
...
74a6eda0f3
|
@ -2,4 +2,3 @@
|
|||
hilbish
|
||||
|
||||
.vim
|
||||
petals/
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
<h1>Hilbish</h1>
|
||||
<blockquote>
|
||||
🎀 a nice lil shell for lua people made with go and lua
|
||||
</blockquote><p align="center">
|
||||
<a href="https://github.com/Hilbis/Hilbish/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues/Hilbis/Hilbish/help%20wanted?color=green" alt="help wanted"></a>
|
||||
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
||||
</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
Hilbish is an interactive Unix-like shell written in Go, with the config
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
- [x] Configuration
|
||||
- [x] Make default config if missing
|
||||
- [x] Tab completion
|
||||
- [x] Custom commands via the shell
|
||||
- [ ] Confirmed windows support
|
||||
- [ ] Readme badges
|
||||
- [x] Hooks
|
||||
- [x] Aliases
|
||||
- [ ] hlua (hilbish lua) - 100% lua in the hilbish interactive shell, cuz why not
|
||||
- [ ] Petals (name of plugins)
|
|
@ -5,7 +5,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/yuin/gopher-lua"
|
||||
"layeh.com/gopher-luar"
|
||||
)
|
||||
|
||||
func Loader(L *lua.LState) int {
|
||||
|
@ -23,8 +22,6 @@ func LuaErr(L *lua.LState, code int) {
|
|||
|
||||
var exports = map[string]lua.LGFunction{
|
||||
"cd": cd,
|
||||
"mkdir": mkdir,
|
||||
"stat": stat,
|
||||
}
|
||||
|
||||
func cd(L *lua.LState) int {
|
||||
|
@ -41,21 +38,3 @@ func cd(L *lua.LState) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func mkdir(L *lua.LState) int {
|
||||
dirname := L.ToString(1)
|
||||
|
||||
// TODO: handle error here
|
||||
os.Mkdir(strings.TrimSpace(dirname), 0744)
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func stat(L *lua.LState) int {
|
||||
path := L.ToString(1)
|
||||
|
||||
// TODO: handle error here
|
||||
pathinfo, _ := os.Stat(path)
|
||||
L.Push(luar.New(L, pathinfo))
|
||||
|
||||
return 1
|
||||
}
|
||||
|
|
5
lua.go
5
lua.go
|
@ -49,10 +49,7 @@ func LuaInit(confpath string) {
|
|||
l.PreloadModule("bait", bait.Loader)
|
||||
|
||||
// Add more paths that Lua can require from
|
||||
l.DoString(`package.path = package.path
|
||||
.. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'
|
||||
.. ';./?/init.lua;./?/?.lua'
|
||||
`)
|
||||
l.DoString("package.path = package.path .. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'")
|
||||
|
||||
err := l.DoFile("/usr/share/hilbish/preload.lua")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue