Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@webframp
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webframp/9005379 to your computer and use it in GitHub Desktop.
Save webframp/9005379 to your computer and use it in GitHub Desktop.
if [[ -n ${ZSH_VERSION-} ]];
then
autoload -U +X bashcompinit && bashcompinit
fi
hcl_update() {
if [ -z "$1" ];
then
echo "Usage: $0 @alias"
else
project=${1:s/@/}
case "$project" in
*_pm)
banner "updating pm task for $project"
hcl alias $project $(hcl tasks | grep -i ${project:s/_pm//} | grep "Project Management" | awk '{print $1,$2}')
;;
*)
banner "Updating dev task for $project"
hcl alias $project $(hcl tasks | grep -i $project | grep "Development" | awk '{print $1,$2}')
;;
esac
fi
}
complete -W "`cat ~/.hcl/aliases`" hcl hcl_update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment