Skip to content

Instantly share code, notes, and snippets.

@leeavital
Created November 24, 2014 17:41
Show Gist options
  • Save leeavital/412c5230e6c583a3c3bb to your computer and use it in GitHub Desktop.
Save leeavital/412c5230e6c583a3c3bb to your computer and use it in GitHub Desktop.
Rants -- angry pants
#!/usr/bin/env bash
if [[ $1 = "-h" || $1 = "--help" || -z $1 ]]
then
cat <<EOD
rants -- angry pants
compile
rants c [project]
rants compile [project]
intellij
rants i [project]
rants idea [project]
test
rants t [project]
rants test [project]
rants will remember the last target for each task
rants idea my-service
rants idea # remembers to use my-service
EOD
exit 0
fi
task=$1
project=$2
case "$task" in
"idea" | "i")
task=idea
flags="--idea-open --idea-source-root=target_root"
;;
"compile" | "c")
task=compile
;;
"test" | "t")
task=test
flags=--test-junit-xml-report
# flags="--test-junit-coverage-html-open"
;;
esac
if [ -z $project ]
then
project=$(cat ~/.rants/last_$task)
fi
echo "current project is: $project"
echo $task $project $flags
./pants goal $task $project $flags
mkdir -p ~/.rants
echo $project > ~/.rants/last_$task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment