Compare commits

..

No commits in common. "1868715b8a7f302474c31d0c3fa5690f3734784d" and "74a6eda0f3b9813b79d75f17ac3d80b679d25cc9" have entirely different histories.

5 changed files with 12 additions and 30 deletions

1
.gitignore vendored
View File

@ -2,4 +2,3 @@
hilbish hilbish
.vim .vim
petals/

View File

@ -2,10 +2,7 @@
<h1>Hilbish</h1> <h1>Hilbish</h1>
<blockquote> <blockquote>
🎀 a nice lil shell for lua people made with go and lua 🎀 a nice lil shell for lua people made with go and lua
</blockquote><p align="center"> </blockquote>
<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>
</div> </div>
Hilbish is an interactive Unix-like shell written in Go, with the config Hilbish is an interactive Unix-like shell written in Go, with the config

10
TODO.md 100644
View File

@ -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)

View File

@ -5,7 +5,6 @@ import (
"strings" "strings"
"github.com/yuin/gopher-lua" "github.com/yuin/gopher-lua"
"layeh.com/gopher-luar"
) )
func Loader(L *lua.LState) int { func Loader(L *lua.LState) int {
@ -23,8 +22,6 @@ func LuaErr(L *lua.LState, code int) {
var exports = map[string]lua.LGFunction{ var exports = map[string]lua.LGFunction{
"cd": cd, "cd": cd,
"mkdir": mkdir,
"stat": stat,
} }
func cd(L *lua.LState) int { func cd(L *lua.LState) int {
@ -41,21 +38,3 @@ func cd(L *lua.LState) int {
return 0 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
View File

@ -49,10 +49,7 @@ func LuaInit(confpath string) {
l.PreloadModule("bait", bait.Loader) l.PreloadModule("bait", bait.Loader)
// Add more paths that Lua can require from // Add more paths that Lua can require from
l.DoString(`package.path = package.path l.DoString("package.path = package.path .. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'")
.. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'
.. ';./?/init.lua;./?/?.lua'
`)
err := l.DoFile("/usr/share/hilbish/preload.lua") err := l.DoFile("/usr/share/hilbish/preload.lua")
if err != nil { if err != nil {