gimme-aws-creds: $(gimme-aws-creds) doesn't work on zsh
When running $(gimme-aws-creds) on zsh, I get the following error: zsh: command not found: #.
Expected Behavior
I expect this command to also work on zsh.
Current Behavior
The above described error occurs and the env variables are not set.
Possible Solution
Remove the comment from the output or make it dependent on the shell being used (i.e. $SHELL).
Steps to Reproduce (for bugs)
- Use
zshas the shell - Run
$(gimme-aws-creds)
Context
I had to run gimme-aws-creds and then copy the output and run it manually.
Your Environment
- App Version used: gimme-aws-creds 2.1.3
- Environment name and version: zsh 5.7.1
- Operating System and version: macOS 10.15.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 24 (1 by maintainers)
you could try
cd ~find -name gimme-aws-credsteoretically it should be./.local/bin/gimme-aws-credsalso you can add
export PATH=~/.local/bin:$PATHin ~/.zshrc file and restart terminalAdded PR https://github.com/Nike-Inc/gimme-aws-creds/pull/192
BTW a simple workaroud until the PR is rolled in:
$(gimme-aws-creds | grep '^EXPORT')This removes all but the lines that start from the
EXPORTbefore passing to bash for execution.https://github.com/Nike-Inc/gimme-aws-creds/blob/master/gimme_aws_creds/main.py#L181
In the above line a string output to the stdout is the cause of the issue. Typically there are two lines logged to the stdout prior to the export statements are the cause of this issue, I think.