mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 15:24:17 +02:00
load -c <file> if exists
This commit is contained in:
@@ -121,10 +121,11 @@ func getDefaultPath() string {
|
|||||||
func (conf *Config) Init() error {
|
func (conf *Config) Init() error {
|
||||||
DefaultConfig := getDefaultPath()
|
DefaultConfig := getDefaultPath()
|
||||||
|
|
||||||
switch {
|
if conf.ConfigFile == "" && fileExists(DefaultConfig) {
|
||||||
case fileExists(DefaultConfig):
|
|
||||||
conf.ConfigFile = DefaultConfig
|
conf.ConfigFile = DefaultConfig
|
||||||
fallthrough
|
}
|
||||||
|
|
||||||
|
switch {
|
||||||
case conf.ConfigFile != "":
|
case conf.ConfigFile != "":
|
||||||
if err := conf.LoadConfig(); err != nil {
|
if err := conf.LoadConfig(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user