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"
"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)