diff options
author | Robby Russell <robby@planetargon.com> | 2011-05-26 01:04:23 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2011-05-26 01:04:23 -0700 |
commit | 54e475844a002a8c2f0793b205c300feb516c24a (patch) | |
tree | 0a8aeedc712d9512bdbb9e960a9a96fa34a8fee0 /plugins/ant/ant.plugin.zsh | |
parent | 41dbf794ba42b4150b1d4f6a47b08f22d9c6f25d (diff) | |
parent | 6a39f8109320e9bd13f006648baf84bb62d1d487 (diff) | |
download | zsh-54e475844a002a8c2f0793b205c300feb516c24a.tar.gz zsh-54e475844a002a8c2f0793b205c300feb516c24a.tar.bz2 zsh-54e475844a002a8c2f0793b205c300feb516c24a.zip |
Merge pull request #139 from clauswitt/master
Fixed an issue with the phing plugin
Diffstat (limited to 'plugins/ant/ant.plugin.zsh')
-rw-r--r-- | plugins/ant/ant.plugin.zsh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh new file mode 100644 index 000000000..0544ac92c --- /dev/null +++ b/plugins/ant/ant.plugin.zsh @@ -0,0 +1,19 @@ +_ant_does_target_list_need_generating () { + if [ ! -f .ant_targets ]; then return 0; + else + accurate=$(stat -f%m .ant_targets) + changed=$(stat -f%m build.xml) + return $(expr $accurate '>=' $changed) + fi +} + +_ant () { + if [ -f build.xml ]; then + if _ant_does_target_list_need_generating; then + sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets + fi + compadd `cat .ant_targets` + fi +} + +compdef _ant ant |