Skip to content

Instantly share code, notes, and snippets.

@nobusue
Created August 21, 2011 08:48
Show Gist options
  • Save nobusue/1160357 to your computer and use it in GitHub Desktop.
Save nobusue/1160357 to your computer and use it in GitHub Desktop.
自炊ヘルパーその2: 指定したフォルダに存在する全フォルダを、フォルダ単位でzipに固める
def rootDir = new File(args[0])
def ant = new AntBuilder()
rootDir.eachDir { dir ->
def srcDirName = dir.name
def path = dir.absoluteFile.parent
def dstFileName = srcDirName + '.zip'
println "Zipping: ${path}\\${srcDirName}"
ant.zip(destfile: "${path}\\${dstFileName}",
basedir: "${path}",
includes: "${srcDirName}/*.*")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment