Created
September 6, 2008 02:24
-
-
Save muness/9071 to your computer and use it in GitHub Desktop.
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
# In ~/.bash_profile define a PROJECT_PARENT_DIRS array and source this script. e.g. | |
# PROJECT_PARENT_DIRS="$HOME/src:$HOME/work" | |
# source ~/.project_aliases.sh | |
if [ -z "${PROJECT_PARENT_DIRS[*]}" ]; then | |
echo "Define a PROJECT_PARENT_DIRS array in ~/.bash_profile" | |
fi | |
for PARENT_DIR in ${PROJECT_PARENT_DIRS[@]} ; do | |
if [ -d "$PARENT_DIR" ]; then | |
for PROJECT_DIR in $(ls $PARENT_DIR); do | |
if [ -d "$PARENT_DIR/$PROJECT_DIR" ]; then | |
alias "$PROJECT_DIR"="cd $PARENT_DIR/$PROJECT_DIR" | |
fi | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment