Created
October 10, 2010 06:10
-
-
Save osima/619011 to your computer and use it in GitHub Desktop.
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
// g100pon #43 zip圧縮・解凍 | |
// | |
// Usage : groovy unzip zipfile | |
if( args.length<1 ){ | |
println 'error' | |
System.exit(0) | |
} | |
zipfile = args[0] | |
new AntBuilder().unzip(src: zipfile, dest:'.') |
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
// g100pon #43 zip圧縮・解凍 | |
// | |
// Usage : groovy zip zipfile [file ...] | |
if( args.length<2 ){ | |
println 'error' | |
System.exit(0) | |
} | |
// 1) | |
zipfile = args[0] | |
// 2) | |
filelist = [] | |
args.each { filelist.add(it) } | |
filelist.remove(0) | |
sb = ''<<'' | |
filelist.each{ sb << it << ' ' } | |
// 3) | |
new AntBuilder().zip(destfile:zipfile, basedir:'.',includes:"${sb.toString()}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment