From 5a42bace67d1c00f2d5d4dcfcccddd14a320a804 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Tue, 18 May 2021 23:33:08 +0200 Subject: [PATCH] Use OS-independent paths for the abs method --- cmd/headscale/cli/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 1560dc2c..b30e43ac 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -22,10 +22,10 @@ type ErrorOutput struct { func absPath(path string) string { // If a relative path is provided, prefix it with the the directory where // the config file was found. - if (path != "") && !strings.HasPrefix(path, "/") { + if (path != "") && !strings.HasPrefix(path, string(os.PathSeparator)) { dir, _ := filepath.Split(viper.ConfigFileUsed()) if dir != "" { - path = dir + "/" + path + path = filepath.Join(dir, path) } } return path