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

aenv is not ruby? #35

Closed
drbachler opened this issue Oct 3, 2017 · 4 comments
Closed

aenv is not ruby? #35

drbachler opened this issue Oct 3, 2017 · 4 comments

Comments

@drbachler
Copy link

when trying to invoke aenv i get the following:

[~]$ aenv                                  
/usr/local/bin/aenv:22:in `load': /var/lib/gems/2.3.0/gems/awsam-0.2.0/bin/aenv:7: `$#' is not allowed as a global variable name (SyntaxError)
/var/lib/gems/2.3.0/gems/awsam-0.2.0/bin/aenv:7: syntax error, unexpected end-of-input, expecting ']'
if [ $# -lt 1 ]; then
      ^
        from /usr/local/bin/aenv:22:in `<main>'
[~]$ 
@yosh-se
Copy link

yosh-se commented Oct 3, 2017

it seems aenv gets installed with a ruby-wrapper that tries to load the script as a ruby file.

@mheffner
Copy link
Owner

mheffner commented Oct 3, 2017

@drbachler Can you show me what the contents of /usr/local/bin/aenv is?

@drbachler
Copy link
Author

Here is my /usr/bin/local/aenv

[~]$` cat /usr/local/bin/aenv 
#!/bin/bash

# Local Variables:
# mode: sh
# End:

if [ $# -lt 1 ]; then
	echo "Usage: aenv cmd [arg1 arg2 ...]"
	exit 1
fi

if [ -z "$AWSAM_ACTIVE_ACCOUNT" ]; then
	echo "Must pick an account first with `aem use <>`"
	exit 1
fi

ENV=$(raem --environ --account $AWSAM_ACTIVE_ACCOUNT --export)
eval $ENV

@mheffner
Copy link
Owner

mheffner commented Oct 3, 2017

Yeah, @yosh-se is probably right about the ruby-wrapper for non-ruby scripts: rubygems/rubygems#88. I'll convert this to a ruby script and see if it fixes the problem.

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