Last active
November 11, 2020 10:44
-
-
Save gokhansolak/f189ece1b267400df4c004af1e42137f to your computer and use it in GitHub Desktop.
Source the workspace of the current working directory automatically, if it matches the pattern. Append this to the .bashrc file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source the workspace of the current working directory automatically | |
home_dir=~/ | |
ws_ptr="(${home_dir}ws/[0-9a-zA-Z ]+)/?" | |
if [[ $PWD =~ $ws_ptr ]]; then | |
ws_dir=${BASH_REMATCH[1]} | |
source $ws_dir/devel/setup.bash | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment