I am new to the Apple "eco system" and I am trying to setup my environment variables for local development.
Here is what I have in my ~/.bash_profile
(simplified for brevity):
export PATH="$JAVA_HOME/bin:$MAVEN_HOME/bin:$DEV_CLI:$PATH"
export DEV_CLI="/path/to/cli/$BRANCH_NAME/bin"
export BRANCH_NAME=dev
What I want here is to have my dev cli accessible from any point in the terminal. The crucial thing here is I want to change the BRANCH_NAME
on different occasions.
Currently my solution works only if I do source ~/.bash_profile
in every terminal tab/window I use.
So let's say that I open new terminal and do:
echo $DEV_CLI
- it will be printed,echo $PATH
- the path for the cli will be missing theresource ~/.bash_profile
echo $PATH
- all variables set in the path will be shown (cli path including)
I am running on Mac High Seirra.
Any help explanation will be deeply appreciated!