Skip to content

Instantly share code, notes, and snippets.

@anujjamwal
Created April 4, 2014 05:00
Show Gist options
  • Save anujjamwal/9968474 to your computer and use it in GitHub Desktop.
Save anujjamwal/9968474 to your computer and use it in GitHub Desktop.
local scripts
PROJECT_DIRECTORIES=()
setup_project_shortcuts ()
{
clear_project_shortcuts
set_cd_shortcut $1
for D in $(find $1 -mindepth 1 -maxdepth 1 -type d)
do
set_cd_shortcut $D
done
unset D
}
clear_project_shortcuts ()
{
for D in $PROJECT_DIRECTORIES
do
N=`basename $D`
unalias "$N"
done
unset N D
}
set_cd_shortcut()
{
N=`basename $1`
alias $N="cd $1"
PROJECT_DIRECTORIES+=($N)
unset N
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment