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

vault not installing command completions for fish #4094

Closed
walterdolce opened this issue Mar 7, 2018 · 4 comments
Closed

vault not installing command completions for fish #4094

walterdolce opened this issue Mar 7, 2018 · 4 comments

Comments

@walterdolce
Copy link

Environment:
Vault v0.9.5 ('36edb4d42380d89a897e7f633046423240b710d9')

  • Vault Version: please see above.
  • Operating System/Architecture: macOS High Sierra 10.13.3

Vault Config File:
N/A

Startup Log Output:
N/A

Expected Behavior:
Vault to do what the documentation says here:

This will automatically install the helpers in your ~/.bashrc or ~/.zshrc, or to ~/.config/fish/completions/vault.fish for Fish users. Then restart your terminal or reload your shell: sh $ exec $SHELL

Actual Behavior:

vault -autocomplete-install                                                                                                                                                                                                      131ms
Error executing CLI: 1 error occurred:

* open {{path_to_my_home_folder}}/.config/fish/completions/vault.fish: no such file or directory

Note: {{path_to_my_home_folder}} has been placed instead of the actual system user's home path.

Steps to Reproduce:

  • Install vault with Homebrew (brew install vault)
  • Ensure vault works as advised on the documentation (Just issue vault on the CLI)
  • Issue vault -autocomplete-install

Important Factoids:
Not sure whether it's an important factoid, but my Fish shell version is fish, version 2.7.1

References:

@walterdolce
Copy link
Author

Looks like the issue is in here -
https://github.com/hashicorp/vault/blob/master/vendor/github.com/posener/complete/cmd/install/utils.go#L40

If any of the directories leading to the file do not exist, the command will fail as the relevant code does not act as an equivalent of mkdir -p. I guess then https://golang.org/pkg/os/#MkdirAll should be used before os.Create.

@jefferai
Copy link
Member

jefferai commented Mar 8, 2018

Please file a bug against posener/complete instead -- what you're seeing is just a vendored copy of that project. Once it's fixed it'll get pulled in the next time we update deps!

@walterdolce
Copy link
Author

Indeed @jefferai. Done. Thanks!

@posener
Copy link

posener commented Mar 9, 2018

Fixed in complete, you can update the vendored complete to v1.1.1

jefferai added a commit that referenced this issue Mar 9, 2018
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

No branches or pull requests

3 participants