Posted By

thebugslayer on 09/23/07


Tagged

svn groovy


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

liqweed
doctorillo


svnadd.groovy Add all svn new status files to working directory


 / Published in: Groovy
 

  1. #!/usr/bin/env groovy
  2.  
  3. // Add all new files in working dir into svn
  4. // Usage svnadd.groovy [working_dir]
  5. def wd = args.size()>0 ? args[0] : '.'
  6. def svnStatusCmd = "svn st $wd"
  7. def svnAddCmd = "svn add "
  8.  
  9. svnStatusCmd.execute().text.split("\n").each{ line ->
  10. matcher = (line =~ /^\?\s+(.+)$/)
  11. if(matcher.find()){
  12. def file = matcher.group(1)
  13. def cmd = svnAddCmd + " " + file
  14. print cmd.execute().text
  15. }
  16. }

Report this snippet  

You need to login to post a comment.