Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

awscli formula creates a zsh completer that doesn't work #30268

Closed
tnarik opened this issue Jun 18, 2014 · 13 comments
Closed

awscli formula creates a zsh completer that doesn't work #30268

tnarik opened this issue Jun 18, 2014 · 13 comments

Comments

@tnarik
Copy link
Contributor

tnarik commented Jun 18, 2014

It creates:

#!/bin/bash
PYTHONPATH="/usr/local/Cellar/awscli/1.3.11/libexec/lib/python2.7/site-packages:/usr/local/Cellar/awscli/1.3.11/lib/python2.7/site-packages" exec "/usr/local/Cellar/awscli/1.3.11/libexec/bin/aws_zsh_completer.sh" "$@"

And, therefore, it doesn't work. It should be doing something in the line of source /usr/local/Cellar/awscli/1.3.11/libexec/bin/aws_zsh_completer.sh.

@jacknagel
Copy link
Contributor

Looks like the file in bin should just be removed, as the completion also gets installed as share/zsh/site-functions/_aws.

@tnarik
Copy link
Contributor Author

tnarik commented Jun 19, 2014

The issue with not creating /usr/local/bin/aws_zsh_completer.sh is that it will make the aws oh-my-zsh plugin fail.
It would be great if both mechanisms would work in unison.

Currently, the aws-cli bundled installer creates a .local/bin/aws_zsh_completer.sh file.

@hydrajump
Copy link
Contributor

@tnarik hi actually zsh completion works fine. As one of the caveats mentions after installation of aws-cli you need to source the aws_zsh_completer.sh,

Add the following to ~/.zshrc to enable zsh completion: source /usr/local/share/zsh/site-functions/_aws

However, your issue seems to be with aws oh-my-zsh plugin and as I don't use either of those I'm afraid I don't know what the problem is.

@tnarik
Copy link
Contributor Author

tnarik commented Jul 22, 2014

Sure, a workaround could be applied but it would be way more straightforward to just source the file and also adding the autocomplete script to a more or less standard PATH folder like the bundled installer does (not a package specific one like the formula does). This will integrate better with the aws oh-my-zsh plugin (and oh-my-zsh is pretty standard for zsh users), doesn't add a useless file (the one under bin) and more closely resemble the bundled installer execution, from my point of view.

@jacknagel
Copy link
Contributor

A pull request with proposed changes will help move this towards a resolution.

@tacgnol
Copy link

tacgnol commented Aug 27, 2014

changing exec to source in /usr/local/Cellar/awscli/1.3.23/bin/aws_zsh_completer.sh fixes the issue, but I don't see how to fix this in the brew .rb file, otherwise i'd submit a proposed change.

@MikeMcQuaid
Copy link
Member

In that case it sounds like it may be an upstream issue.

@jacknagel
Copy link
Contributor

bin/aws_zsh_completer.sh is a wrapper script created by homebrew I think.

@jacknagel
Copy link
Contributor

I don't really understand this comment:

it would be way more straightforward to just source the file and also adding the autocomplete script to a more or less standard PATH folder like the bundled installer does (not a package specific one like the formula does)

I tend to agree with this comment: #30268 (comment)

Basically I don't understand why a completion script is expected to be installed into bin. That's not what it is for.

@tacgnol
Copy link

tacgnol commented Aug 27, 2014

It is probably worthwhile modifying the oh-my-zsh script to search for somewhere other than bin and not use the broken home-brew script (and I can submit something to that code base), but really the one line aws_zsh_completer.sh script that gets installed with brew needs fixing.

As I said in my first comment, the problem is with the use of exec rather than source. My knowledge of this stuff is limited, but the way the script runs via exec it's producing a blank zsh fpath, which causes issues with the autoload command in the original awscli aws_zsh_completer.sh script.

I still don't see where the the bin/aws_zsh_completer.sh wrapper script is created by homebrew. Can anyone give any pointers to that?

@jacknagel
Copy link
Contributor

I still don't see where the the bin/aws_zsh_completer.sh wrapper script is created by homebrew. Can anyone give any pointers to that?

https://github.com/Homebrew/homebrew/blob/a916da27b18bb5844ebe6c425305c338939e8d8e/Library/Formula/awscli.rb#L81

tacgnol added a commit to tacgnol/oh-my-zsh that referenced this issue Aug 30, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
@jacknagel
Copy link
Contributor

It looks like this was addressed in oh-my-zsh. If there is more that needs to be done, please open a pull request.

ArjenSchwarz pushed a commit to ArjenSchwarz/oh-my-zsh that referenced this issue Sep 16, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
gsemet pushed a commit to gsemet/oh-my-zsh that referenced this issue Sep 17, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
lewg pushed a commit to lewg/oh-my-zsh that referenced this issue Sep 17, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
noj pushed a commit to noj/oh-my-zsh that referenced this issue Nov 4, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
benjaoming pushed a commit to benjaoming/oh-my-zsh that referenced this issue Nov 28, 2014
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
kenton pushed a commit to kenton/oh-my-zsh that referenced this issue Jan 9, 2015
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
kiwiupover pushed a commit to kiwiupover/dot-files that referenced this issue Jan 23, 2015
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
hbpoison pushed a commit to hbpoison/oh-my-zsh that referenced this issue Aug 14, 2015
the mangled version installed into $(brew-prefix)/bin if using
homebrew installed awscli on OSX.

This was discussed here - Homebrew/legacy-homebrew#30268
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants