Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not return an error when blank config files are read #55

Merged
merged 1 commit into from Jul 25, 2022

Conversation

samcoe
Copy link
Contributor

@samcoe samcoe commented Jul 25, 2022

This PR changes the behavior when reading empty config files, previously we would return an ErrInvalidFormat and now we will return a blank yaml map. This fixes backwards compatibility where some cli users had blank host.yml files.

Fixes cli/cli#5949

@samcoe samcoe self-assigned this Jul 25, 2022
@samcoe samcoe requested a review from mislav July 25, 2022 08:24
@@ -91,7 +91,6 @@ func Test_sshParser_absolutePath(t *testing.T) {
parentFile string
arg string
want string
wantErr bool
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused so I removed it, not related to other changes in the PR.

Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@samcoe samcoe merged commit ce18bbb into trunk Jul 25, 2022
@samcoe samcoe deleted the fix-blank-config-bug branch July 25, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid config file ~/.config/gh/hosts.yml: invalid format
2 participants