From d2a0d0333241d8f31718e4e8765f57d9ec68f7df Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Mon, 26 Nov 2018 15:18:56 +0300 Subject: [PATCH] Allow specifying absolute paths in -c command line option. Closes #424. --- app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 647ffa63..add8a262 100644 --- a/app.go +++ b/app.go @@ -213,7 +213,10 @@ func promptAndGetPassword(prompt string) (string, error) { } func askUsernamePasswordIfPossible() error { - configfile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename) + configfile := config.ourConfigFilename + if !filepath.IsAbs(configfile) { + configfile = filepath.Join(config.ourBinaryDir, config.ourConfigFilename) + } _, err := os.Stat(configfile) if !os.IsNotExist(err) { // do nothing, file exists