Skip to content

Instantly share code, notes, and snippets.

@jmatsu
Last active February 17, 2016 05:45
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 jmatsu/d1d7374571e91a84b43f to your computer and use it in GitHub Desktop.
Save jmatsu/d1d7374571e91a84b43f to your computer and use it in GitHub Desktop.

sbt

Output 'sbt test-only' with appropreate classes.

sbt_test_only () {
	[[ $# -eq 0 ]] && return 1
	local classes=$(git log --name-only --oneline $1..HEAD|grep "^test"|sort|uniq|while read line; do echo "$(head -1 $line|awk '$0=$2').$(cat $line|grep "object"|awk '$0=$2')"; done|xargs)  
	echo "sbt \"test-only $classes\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment