Created
August 21, 2011 08:48
-
-
Save nobusue/1160357 to your computer and use it in GitHub Desktop.
自炊ヘルパーその2: 指定したフォルダに存在する全フォルダを、フォルダ単位でzipに固める
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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