Skip to content

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