Return to Snippet

Revision: 3846
at September 23, 2007 20:13 by thebugslayer


Initial Code
#!/usr/bin/env groovy

// Add all new files in working dir into svn
// Usage svnadd.groovy [working_dir]
def wd = args.size()>0 ? args[0] : '.'
def svnStatusCmd = "svn st $wd"
def svnAddCmd = "svn add "

svnStatusCmd.execute().text.split("\n").each{ line ->
       matcher = (line =~ /^\?\s+(.+)$/)
       if(matcher.find()){
               def file = matcher.group(1)
               def cmd = svnAddCmd + " " + file
               print cmd.execute().text
       }
}

Initial URL

                                

Initial Description

                                

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

Initial Tags
svn, groovy

Initial Language
Groovy