Skip to content

Commit

Permalink
Add global config path for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenCursor committed Aug 26, 2024
1 parent 4da297f commit d4f5af0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
"fmt"
"os"
"runtime"

"github.com/spf13/viper"
)
Expand All @@ -21,7 +22,11 @@ func init() {
config.SetConfigName("config")
config.SetConfigType("yaml")

// TODO: proper global config path setup
sep := string(os.PathSeparator)
if runtime.GOOS == "linux" {
config.AddConfigPath("/etc/mcli")
}
config.AddConfigPath(dir + sep + "modem-cli")

// -- Defaults -- //
Expand Down

0 comments on commit d4f5af0

Please sign in to comment.