We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a3e19b commit 8ef9006Copy full SHA for 8ef9006
1 file changed
internal/config/config.go
@@ -4,6 +4,8 @@ import (
4
"fmt"
5
"log"
6
"net/url"
7
+ "os"
8
+ "path/filepath"
9
"strings"
10
11
"github.com/fsnotify/fsnotify"
@@ -162,6 +164,12 @@ func LoadConfig() {
162
164
viper.AddConfigPath("/etc/docStreamer")
163
165
viper.AddConfigPath("$HOME/.docStreamer")
166
167
+ ex, err := os.Executable()
168
+ if err == nil {
169
+ exePath := filepath.Dir(ex)
170
+ viper.AddConfigPath(exePath)
171
+ }
172
+
173
if err := viper.ReadInConfig(); err != nil {
174
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
175
log.Println("Config file not found, using defaults and environment variables.")
0 commit comments