Set default config on configuration error to allow listing midi connections before configuration.

This commit is contained in:
James Coleman 2024-09-07 21:29:34 -05:00
parent 8fe0a0fb2f
commit 0442655a93
3 changed files with 3 additions and 2 deletions

BIN
.config.yaml.kate-swp Normal file

Binary file not shown.

View File

@ -48,7 +48,7 @@ func (a *App) ReadConfig() {
} else if _, err := os.Stat(etcConfig); err == nil { } else if _, err := os.Stat(etcConfig); err == nil {
configFile = etcConfig configFile = etcConfig
} else { } else {
log.Fatal("Unable to find a configuration file.") log.Println("Unable to find a configuration file.")
} }
// Load the configuration file. // Load the configuration file.
@ -68,6 +68,7 @@ func (a *App) ReadConfig() {
fig.Dirs(filePath), fig.Dirs(filePath),
) )
if err != nil { if err != nil {
app.config = config
log.Printf("Error parsing configuration: %s\n", err) log.Printf("Error parsing configuration: %s\n", err)
return return
} }

View File

@ -15,7 +15,7 @@ import (
const ( const (
serviceName = "midi-request-trigger" serviceName = "midi-request-trigger"
serviceDescription = "Takes trigger MIDI messages by HTTP or MQTT requests and trigger HTTP or MQTT requests by MIDI messages" serviceDescription = "Takes trigger MIDI messages by HTTP or MQTT requests and trigger HTTP or MQTT requests by MIDI messages"
serviceVersion = "0.2" serviceVersion = "0.2.1"
) )
// App is the global application structure for communicating between servers and storing information. // App is the global application structure for communicating between servers and storing information.