Skip to content

Commit

Permalink
improve config file location details
Browse files Browse the repository at this point in the history
  • Loading branch information
yunginnanet committed Sep 15, 2021
1 parent 492a696 commit 010392b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ func Init() {
snek.AddConfigPath(loc)
}

Filename = snek.ConfigFileUsed()

if err = snek.MergeInConfig(); err != nil {
if _, err := os.Stat(prefConfigLocation); os.IsNotExist(err) {
if err = os.Mkdir(prefConfigLocation, 0755); err != nil {
Expand All @@ -102,6 +100,10 @@ func Init() {
Filename = newconfig
}

if len(Filename) < 1 {
Filename = snek.ConfigFileUsed()
}

associate()
}

Expand Down Expand Up @@ -132,6 +134,7 @@ func acquireClue() {
configLocations = append(configLocations, "/etc/"+title+"/")
configLocations = append(configLocations, "./")
configLocations = append(configLocations, "../")
configLocations = append(configLocations, "../../")
}

func loadCustomConfig(path string) {
Expand Down

0 comments on commit 010392b

Please sign in to comment.