From c43aab6a603332ac76049cbf2a75574066e0e6b6 Mon Sep 17 00:00:00 2001 From: sammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 1 May 2021 15:35:43 -0400 Subject: [PATCH] fix: make appendPath expand ~ to home dir --- lua.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua.go b/lua.go index bb0a9f8..1cc39cd 100644 --- a/lua.go +++ b/lua.go @@ -2,10 +2,12 @@ package main import ( "fmt" + "os" + "strings" + "hilbish/golibs/bait" "hilbish/golibs/commander" "hilbish/golibs/fs" - "os" "github.com/yuin/gopher-lua" ) @@ -118,6 +120,7 @@ func hshalias(L *lua.LState) int { func hshappendPath(L *lua.LState) int { path := L.CheckString(1) + path = strings.Replace(path, "~", curuser.HomeDir, 1) os.Setenv("PATH", os.Getenv("PATH") + ":" + path)