Last active
August 29, 2015 13:56
-
-
Save webframp/9005379 to your computer and use it in GitHub Desktop.
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
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