common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
956 stars 90 forks source link

How to disable annoying message "the Granted alias has already been added to /Users/myuser/.zshenv"? #592

Closed ls-amet-umierov closed 5 months ago

ls-amet-umierov commented 5 months ago

I use assume command in my bash script which assuming role every time I need to login to AWS SSO.

In the output of my script I can see the message every time when:

assume --auto-configure-shell my-profile
[✘] the Granted alias has already been added to /Users/myuser/.zshenv

I definitely could redirect the output to /dev/null like that assume --auto-configure-shell my-profile but when users run script for the first time I want to keep output for interaction with user (e.g. setup preferred browser). So redirect to /dev/null doesn't work for me.

Is there any way to skip this message in my output?

shwethaumashanker commented 5 months ago

@ls-amet-umierov adding export GRANTED_ALIAS_CONFIGURED="true" to your script or ~/.zshenv should do the trick. Let me know if that works for you!

ls-amet-umierov commented 5 months ago

This helped, thank you.