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

Exec instead of formatting environment variables to eval #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gabrielg
Copy link

@gabrielg gabrielg commented Mar 1, 2018

This modifies aws-env to set the environment variables and exec the given command and arguments, rather than forming a string to pass to the shell's eval. This saves us the trouble of having to escape the string for the shell.

This PR pretty significantly changes how aws-env works, so entirely understood if you'd rather not merge it.

@orfin
Copy link
Contributor

orfin commented Mar 13, 2018

Thanks @gabrielg :-) When working on aws-env we also considered such approach but we decided it will be less risky to not rely on Go program (e.g. memory leak on aws-env could cause problems for long running processes). But you are right - on the other hand, eval introduces trickier work with escaping ENV parameters etc.

It may be something that we could add as another branch? WDYT?

@orfin
Copy link
Contributor

orfin commented Jun 5, 2018

@gabrielg WDYT about adding additional 'exec' options flag?

Something like aws-env --exec|-e

AWS_ENV_PATH=/prod/my-app/ AWS_REGION=us-west-2 ./aws-env --exec node -e "console.log(process.env)"

that won't break backward compatibility and will allow for that superb nice usage :-)

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.

3 participants