A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/ec92e82966b4ee56a734d7c509872b47dfff9801 below:

fix loading of the default configuration file · orgrim/pg_back@ec92e82 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+7

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+7

-1

lines changed Original file line number Diff line number Diff line change

@@ -486,6 +486,12 @@ func loadConfigurationFile(path string) (options, error) {

486 486 487 487

cfg, err := ini.Load(path)

488 488

if err != nil {

489 +

if path == defaultCfgFile && errors.Is(err, os.ErrNotExist) {

490 +

// Fallback on defaults when the default configuration does not exist

491 +

l.Verbosef("default configuration file %s does not exist, skipping\n", defaultCfgFile)

492 +

return opts, nil

493 +

}

494 + 489 495

return opts, fmt.Errorf("Could load configuration file: %v", err)

490 496

}

491 497 Original file line number Diff line number Diff line change

@@ -150,7 +150,7 @@ func run() (retVal error) {

150 150

// Load configuration file and allow the default configuration

151 151

// file to be absent

152 152

configOpts, err := loadConfigurationFile(cliOpts.CfgFile)

153 -

if err != nil && cliOpts.CfgFile != defaultCfgFile {

153 +

if err != nil {

154 154

return err

155 155

}

156 156

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4