Closed gesellix closed 4 years ago
Executing the awsume -s
commands should function exactly the same as executing awsume
.
In scripts executed through certain shells, it might be necessary to source awsume every time it's run (or define an alias to do this at the beginning of your script).
Aside from that, the commands are output to stdout, while the expiration messages are output to stderr
Any of those should help you get to a solution, I'd be interested to hear your use case if not though
expiration messages are output to stderr
Ah, I need to check that, that would help a lot.
Redirecting stderr works, thanks!
Regarding my use case: I don't want to clutter my local setup with specific Python, PIP, PIPX or other dependencies, so I always try to wrap everything in a dedicated container (Docker). Side effect is easier cross-platform compatibility.
My progress so far: https://github.com/gesellix/awsume#manage-your-shells-environment
When using
awsume -s profile
in an empty environment, awsume prints token expiry messages just before the desiredexport
statements, e.g. like this:I would like to use
--show-commands
in scripts, but I only need theexport
statements. TheSession token will expire ...
andRole credentials will expire ...
messages aren't necessary.Would be possible to disable the output of those messages? Maybe it would be enough to expose the existing
is_interactive
argument as command line option?