From 58b920ade07b5081903fba9cdcf23bbe346a26f7 Mon Sep 17 00:00:00 2001 From: Dmitry Chepurovskiy Date: Thu, 4 Jul 2019 04:42:51 +0300 Subject: [PATCH] Fix use command to work with path with tilda for configDir --- cmd/helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/helpers.go b/cmd/helpers.go index 83ba775..1f5e9e1 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -73,6 +73,7 @@ func getProfilePath(configDir, profileName string) string { // Check if file exists func isFileExist(path string) bool { - _, err := os.Stat(path) + absolutePath, _ := homedir.Expand(path) + _, err := os.Stat(absolutePath) return !os.IsNotExist(err) }