Manager: Fix logic error detecting first-time run

If the config file is missing, `true` should be returned.
This commit is contained in:
Sybren A. Stüvel 2022-07-14 18:24:07 +02:00
parent 8719103462
commit 8b494dc448

View File

@ -32,7 +32,7 @@ func (s *Service) IsFirstRun() (bool, error) {
switch { switch {
case errors.Is(err, fs.ErrNotExist): case errors.Is(err, fs.ErrNotExist):
// No configuration means first run. // No configuration means first run.
return false, nil return true, nil
case err != nil: case err != nil:
return false, fmt.Errorf("loading %s: %w", configFilename, err) return false, fmt.Errorf("loading %s: %w", configFilename, err)
} }