Skip to content

Instantly share code, notes, and snippets.

@paganotoni
Last active October 2, 2015 01:47
Show Gist options
  • Save paganotoni/2147570 to your computer and use it in GitHub Desktop.
Save paganotoni/2147570 to your computer and use it in GitHub Desktop.
Projects Function for Zsh
# 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