Fix bug 'Unable to load file' in altsrc #1086
What type of PR is this?
What this PR does / why we need it:
When using altsrc, an 'Unable to load Yaml/TOML/etc file' error occurs during startup of the executable file, which can only be resolved by using the flag used to specify the path to the configuration file.
For example, when you run cli app with this configuration:
In the following cases, an error occurs:
And in the following cases, an error does not occur:
To solve this bug, checks were added whether the flag used to specify the path to the configuration file is set. If it is not specified, MapInputSource with default values is returned.
After applying the changes from this PR, the executable file can be run without the flag used to specify the path to the configuration file:
GitHub CI (more precisely, actions/checkout@v1 - https://github.com/urfave/cli/blob/master/.github/workflows/cli.yml#L36) is trying to checkout the non-existent branch fix-altsrc-nil-source-flag (it is present in my fork), like this:
A similar issue in actions/checkout@v1 was discussed here: actions/checkout#23
Unfortunately, I do not know how to solve this problem