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

Don't error out in case home cannot be found #1318

Merged
merged 1 commit into from
Mar 22, 2018
Merged

Don't error out in case home cannot be found #1318

merged 1 commit into from
Mar 22, 2018

Conversation

vdemeester
Copy link
Contributor

There is a few case where home could not be found (and would not be
needed). Especially as this piece of code is only there to set a
default value for a flag.

cc @cyli @n4ss @endophage

Signed-off-by: Vincent Demeester vincent@sbr.pm

@n4ss
Copy link
Contributor

n4ss commented Mar 21, 2018

LGTM! (when tests are green >:) )

@@ -77,10 +77,7 @@ func (n *notaryCommander) parseConfig() (*viper.Viper, error) {
// Get home directory for current user
homeDir, err := homedir.Dir()
if err != nil {
return nil, fmt.Errorf("cannot get current user home directory: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we should specify that the default notary directory instead will be $(pwd)/.notary maybe, as part of the warning, since we are still setting a default, it just may be in an unexpected place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see what you mean, can definitely change that 😉

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

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

Other than a nitpick about being more clear in the warning that we may be writing data someplace the user doesn't expect, LGTM.

There is a few case where home could not be found (and would not be
needed). Especially as this piece of code is only there to set a
default value for a flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@HuKeping
Copy link
Contributor

LGTM

@HuKeping HuKeping merged commit c3fe777 into notaryproject:master Mar 22, 2018
@vdemeester vdemeester deleted the dont-fail-me-home branch March 22, 2018 13:14
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.

4 participants