Last active
October 2, 2015 01:47
-
-
Save paganotoni/2147570 to your computer and use it in GitHub Desktop.
Projects Function for Zsh
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
# This is my projects function | |
PROJECTS_DIR="/Users/$(whoami)/Projects" | |
p() { | |
PROJECT_NAME="$1"; | |
if [ -d "$PROJECTS_DIR/$PROJECT_NAME" ]; then | |
cd "$PROJECTS_DIR/$PROJECT_NAME"; | |
else | |
echo "\n| ERROR: Hey! Project '$PROJECT_NAME' doesn't exist \n| please check the folder name exists inside your \$PROJECTS_FOLDER\n" | |
fi | |
} | |
_projects_list() { | |
reply=($(ls $PROJECTS_DIR)) | |
} | |
compctl -K _projects_list p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment