From 566a9fecec3fba9ff43d49d541a8aedbab226f28 Mon Sep 17 00:00:00 2001 From: strNophix Date: Sun, 13 Feb 2022 13:19:58 +0100 Subject: [PATCH] inv-alias now uses the absolute path for regions --- scripts/inv-alias.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/inv-alias.go b/scripts/inv-alias.go index 7c285eb..530076b 100644 --- a/scripts/inv-alias.go +++ b/scripts/inv-alias.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "log" "os" + "path/filepath" "regexp" "strings" ) @@ -131,11 +132,17 @@ func main() { os.Exit(1) } + p, err := filepath.Abs(os.Args[2]) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + switch os.Args[1] { case "add": - AddAliases(os.Args[2]) + AddAliases(p) case "rm": - RemoveAliases(os.Args[2]) + RemoveAliases(p) default: fmt.Println(u) os.Exit(1)