Compare commits
2 Commits
446ac616bf
...
b419cfde69
Author | SHA1 | Date | |
---|---|---|---|
b419cfde69 | |||
534b3e5fcd |
@ -126,14 +126,14 @@ func setupConfig() {
|
|||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
viper.AddConfigPath(".")
|
viper.AddConfigPath(".")
|
||||||
|
|
||||||
err = viper.ReadInConfig()
|
|
||||||
|
|
||||||
viper.BindEnv("DEBUG")
|
viper.BindEnv("DEBUG")
|
||||||
viper.BindEnv("DISCORD_TOKEN")
|
viper.BindEnv("DISCORD_TOKEN")
|
||||||
viper.BindEnv("OPEN_WEATHER_MAP_TOKEN")
|
viper.BindEnv("OPEN_WEATHER_MAP_TOKEN")
|
||||||
|
|
||||||
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
log.Fatalf("fatal error config file: %v", err)
|
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
||||||
|
log.Fatalf("fatal error config file: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = viper.Unmarshal(&C)
|
err = viper.Unmarshal(&C)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
version: "3.9"
|
version: "3.9"
|
||||||
services:
|
services:
|
||||||
bot:
|
bot:
|
||||||
@ -6,3 +7,5 @@ services:
|
|||||||
- BEEPBOOP_DISCORD_TOKEN
|
- BEEPBOOP_DISCORD_TOKEN
|
||||||
- BEEPBOOP_OPEN_WEATHER_MAP_TOKEN
|
- BEEPBOOP_OPEN_WEATHER_MAP_TOKEN
|
||||||
- BEEPBOOP_DEBUG=true
|
- BEEPBOOP_DEBUG=true
|
||||||
|
volumes:
|
||||||
|
- ./config.toml:/config.toml
|
Loading…
Reference in New Issue
Block a user