mirror of
https://github.com/harness/drone.git
synced 2025-05-07 20:34:04 +08:00
Exit app if config cannot be read correctly
This commit is contained in:
parent
dafbd12056
commit
521cf4e8c9
@ -5,6 +5,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/drone/config"
|
"github.com/drone/config"
|
||||||
@ -83,7 +84,11 @@ func main() {
|
|||||||
// Parses config data. The config data can be stored in a config
|
// Parses config data. The config data can be stored in a config
|
||||||
// file (.toml format) or environment variables, or a combo.
|
// file (.toml format) or environment variables, or a combo.
|
||||||
config.SetPrefix("DRONE_")
|
config.SetPrefix("DRONE_")
|
||||||
config.Parse(conf)
|
err := config.Parse(conf)
|
||||||
|
if err != nil {
|
||||||
|
log.Errf("Unable to parse config: %v", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Setup the remote services. We need to execute these to register
|
// Setup the remote services. We need to execute these to register
|
||||||
// the remote plugins with the system.
|
// the remote plugins with the system.
|
||||||
|
Loading…
Reference in New Issue
Block a user