Skip to content

Instantly share code, notes, and snippets.

@osima
Created October 10, 2010 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osima/619011 to your computer and use it in GitHub Desktop.
Save osima/619011 to your computer and use it in GitHub Desktop.
zip圧縮・解凍
// 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:'.')
// 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