mirror of https://github.com/Hilbis/Hilbish
fix: make appendPath expand ~ to home dir
parent
9934ba417f
commit
c43aab6a60
5
lua.go
5
lua.go
|
@ -2,10 +2,12 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"hilbish/golibs/bait"
|
"hilbish/golibs/bait"
|
||||||
"hilbish/golibs/commander"
|
"hilbish/golibs/commander"
|
||||||
"hilbish/golibs/fs"
|
"hilbish/golibs/fs"
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/yuin/gopher-lua"
|
"github.com/yuin/gopher-lua"
|
||||||
)
|
)
|
||||||
|
@ -118,6 +120,7 @@ func hshalias(L *lua.LState) int {
|
||||||
|
|
||||||
func hshappendPath(L *lua.LState) int {
|
func hshappendPath(L *lua.LState) int {
|
||||||
path := L.CheckString(1)
|
path := L.CheckString(1)
|
||||||
|
path = strings.Replace(path, "~", curuser.HomeDir, 1)
|
||||||
|
|
||||||
os.Setenv("PATH", os.Getenv("PATH") + ":" + path)
|
os.Setenv("PATH", os.Getenv("PATH") + ":" + path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue