inv-alias now uses the absolute path for regions

This commit is contained in:
strNophix 2022-02-13 13:19:58 +01:00
parent e652c1e1c5
commit 566a9fecec

View File

@ -8,6 +8,7 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"path/filepath"
"regexp" "regexp"
"strings" "strings"
) )
@ -131,11 +132,17 @@ func main() {
os.Exit(1) os.Exit(1)
} }
p, err := filepath.Abs(os.Args[2])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
switch os.Args[1] { switch os.Args[1] {
case "add": case "add":
AddAliases(os.Args[2]) AddAliases(p)
case "rm": case "rm":
RemoveAliases(os.Args[2]) RemoveAliases(p)
default: default:
fmt.Println(u) fmt.Println(u)
os.Exit(1) os.Exit(1)