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


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



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.