-
-
Save pieterv/1586368 to your computer and use it in GitHub Desktop.
Navigate to a project code folder in a users Sites directory
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
# Move to site dir | |
function site() | |
{ | |
# Colors | |
col='\e[41m' | |
txtrst='\e[0m' | |
# Find dir | |
cd ~ && cd "./Sites" | |
if [ $1 ]; then | |
if [ -d "./$1" ]; then | |
cd "./$1" | |
a=$(echo $1 | tr "[:lower:]" "[:upper:]") | |
printf "\n$col********************** Site $a ********************\n$txtrst" | |
if [ -d "./source" ]; then | |
cd "./source" | |
elif [ -d "./trunk" ]; then | |
cd "./trunk" | |
else | |
echo "No code directory found..." | |
fi | |
else | |
printf "'$col$1$txtrst' is not a valid project name\n" | |
echo "Projects:" && ls -Gd */ | |
fi | |
else | |
printf "\n$col********************** Sites ********************\n$txtrst" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment