mozilla-aws-cli icon indicating copy to clipboard operation
mozilla-aws-cli copied to clipboard

Explore using pexec to spawn a subshell instead of making the user invoke $(maws)

Open gene1wood opened this issue 1 year ago • 0 comments

Currently we require users to execute maws in a subshell (with a command like $(maws)) and then execute the output from that subshell (which outputs something like source /tmp/foo.tmp).

This is good because the user ends up in the same shell they were in before, but now they have environment variables set enabling access to AWS.

Should we change to the model that hatch uses which spawns a subshell and then controls it using pexec

Here's how hatch does it

https://github.com/pypa/hatch/blob/63b692e3ac7c4156edbbf382b849eaa8707607eb/src/hatch/utils/shells.py#L97-L128

This would have the benefit of no longer requiring the user to invoke maws with a weird syntax like $(maws). The downside would be that the user ends up in a subshell in which they interact with AWS.

Then again, maybe the fact that they're in a subshell with AWS access isn't a downside, not sure.

Additionally we could add this functionality and have this be an optional way to interact with maws, supporting the existing method and this new one.

gene1wood avatar Mar 25 '23 02:03 gene1wood