Created
September 22, 2013 08:00
-
-
Save brianjriddle/6657796 to your computer and use it in GitHub Desktop.
Ant tasks to check if working directory is clean.
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="git" default="is-working-directory-clean"> | |
<target name="-git-status"> | |
<exec executable="git" outputproperty="git.status.message" failifexecutionfails="false" errorproperty=""> | |
<arg value="status"/> | |
<arg value="--short"/> | |
</exec> | |
<condition property="git.clean.wd"> | |
<and> | |
<equals arg1="${git.status.message}" arg2="" trim="yes"/> | |
</and> | |
</condition> | |
</target> | |
<target name="is-working-directory-clean" | |
depends="-git-status"> | |
<fail unless="${git.clean.wd}" message="Working directory is not clean"/> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment