fix: clarify use of cwms-cli env activate - #269
Conversation
|
@Enovotny may want to consider revising the |
krowvin
left a comment
There was a problem hiding this comment.
This PR looks to focus around documentation of the issue we saw where a user tried to run cwms-cli env activate on their Unix box.
It failed, and they came to us saying it does not work.
If we only include documentation, I think, this will happen again and we will have to then send them the new doc links.
To take us out of the middle,
I propose we either:
- Wrap it in a try/except block for the specific error
- Add an if statement and actively get ahead of it
To then say "You must manually run the activate command, shell spawning is not supported on your system:"
Then you print
eval "$(cwms-cli env export <name> --format bash)"and you print
It's not as good as running it for them, but it's a nice holdover to say we are aware and here's how they can activate.
You could also have a note to the docs link "To make this change permanent read the docs here:"
If you do go this route, see how I handle docs links in other places of CWMS-CLI
krowvin
left a comment
There was a problem hiding this comment.
Looks good! Color is a nice touch!


Clarifies how
cwms-cli env activateworks. The spawning of a new shell with environment variables like CDA_API_ROOT and CDA_API_KEY may be overriden if these are specified in a .bash_profile or .bashrc file. This provides better documentation on how to deal with that.eval "$(cwms-cli env export <name> --format bash)"in the bashrc to have cwms-cli provide the environment variables on an onprem server.cwms-cli env activate <name>may not work as intended if environment variables (e.g. CDA_API_ROOT) are defined in the bashrc and provided documentation on how to avoid that.AI Assisted