svnremove.groovy Remove all svn removed files from working dir


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/usr/bin/env groovy
  2.  
  3. // Remove all svn removed files from working dir
  4. def wd = args.size()>0 ? args[0] : '.'
  5. def svnStatusCmd = "svn st $wd"
  6. def svnRemoveCmd = "svn rm "
  7.  
  8. svnStatusCmd.execute().text.split("\n").each{ line ->
  9. matcher = (line =~ /^\!\s+(.+)$/)
  10. if(matcher.find()){
  11. def file = matcher.group(1)
  12. def cmd = svnRemoveCmd + " " + file
  13. print cmd.execute().text
  14. }
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.