Skip to content

Commit

Permalink
lab: Fix startup error
Browse files Browse the repository at this point in the history
For a very long time we've had an error that can be reproduced by
executing

git clone https://github.com/zaquestion/lab
cd lab
make
./lab

This results in "Error: User authentication failed.  This is likely due to
a misconfigured Personal Access Token.  Verify the token or token_load
config settings before attempting to authenticate." being output to the
screen even though a valid config exists in ~/.config/lab/lab.toml.

This occurs because after the make a lab executable is created in the
local directory and it is treated as a config file.  lab attempts to
interpret this binary as a config file and the above error is reported.

Fix the startup error by explicitly looking for lab.toml instead of just
lab.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
  • Loading branch information
prarit committed Oct 13, 2021
1 parent 7540b64 commit 014c615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func LoadMainConfig() (string, string, string, string, bool) {
}

MainConfig = viper.New()
MainConfig.SetConfigName("lab")
MainConfig.SetConfigName("lab.toml")
MainConfig.SetConfigType("toml")
// The local path (aka 'dot slash') does not allow for any
// overrides from the work tree lab.toml
Expand Down

0 comments on commit 014c615

Please sign in to comment.