mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "b86912be568fa814a5f4b42c3f5f60ec2ddf4a3d" and "2c2eb8d69a760f45fbdfba7d0b670f0c02417631" have entirely different histories.
b86912be56
...
2c2eb8d69a
10
lua.go
10
lua.go
|
@ -123,14 +123,10 @@ func hshalias(L *lua.LState) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
func hshappendPath(L *lua.LState) int {
|
func hshappendPath(L *lua.LState) int {
|
||||||
dir := L.CheckString(1)
|
path := L.CheckString(1)
|
||||||
dir = strings.Replace(dir, "~", curuser.HomeDir, 1)
|
path = strings.Replace(path, "~", curuser.HomeDir, 1)
|
||||||
pathenv := os.Getenv("PATH")
|
|
||||||
|
|
||||||
// if dir isnt already in $PATH, add it
|
os.Setenv("PATH", os.Getenv("PATH") + ":" + path)
|
||||||
if !strings.Contains(pathenv, dir) {
|
|
||||||
os.Setenv("PATH", pathenv + ":" + dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
4
main.go
4
main.go
|
@ -18,7 +18,7 @@ import (
|
||||||
"golang.org/x/term"
|
"golang.org/x/term"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "v0.4.0"
|
var version = "v0.4.1-dev.9"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
l *lua.LState
|
l *lua.LState
|
||||||
|
@ -174,7 +174,7 @@ func ContinuePrompt(prev string) (string, error) {
|
||||||
}
|
}
|
||||||
cont = strings.TrimSpace(cont)
|
cont = strings.TrimSpace(cont)
|
||||||
|
|
||||||
return prev + strings.TrimSuffix(cont, "\n"), nil
|
return prev + " " + strings.TrimSuffix(cont, "\n"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// This semi cursed function formats our prompt (obviously)
|
// This semi cursed function formats our prompt (obviously)
|
||||||
|
|
Loading…
Reference in New Issue