Merge pull request #110 in DNS/adguard-dns from bugfix/424 to master

* commit 'd2a0d0333241d8f31718e4e8765f57d9ec68f7df':
  Allow specifying absolute paths in -c command line option.
This commit is contained in:
Eugene Bujak 2018-11-26 15:20:38 +03:00
commit c995726f78
1 changed files with 4 additions and 1 deletions

5
app.go
View File

@ -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