From 1f1f926fe3d47a10393cd0eea4a6dbc990a4fb06 Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Tue, 20 Jun 2017 15:50:46 +0300 Subject: [PATCH] Using absolute paths for config dir (fixes #34) --- cmd/selenoid.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/selenoid.go b/cmd/selenoid.go index ecc8dbe..0469364 100644 --- a/cmd/selenoid.go +++ b/cmd/selenoid.go @@ -118,10 +118,13 @@ var selenoidCmd = &cobra.Command{ func getConfigDir(elem ...string) string { usr, err := user.Current() + var p string if err != nil { - return filepath.Join(elem...) + p = filepath.Join(elem...) } - return filepath.Join(append([]string{usr.HomeDir}, elem...)...) + p = filepath.Join(append([]string{usr.HomeDir}, elem...)...) + ap, _ := filepath.Abs(p) + return ap } func getSelenoidConfigDir() string {