Skip to content

Instantly share code, notes, and snippets.

@michalbcz
Created October 22, 2011 11:57
Show Gist options
  • Save michalbcz/1305912 to your computer and use it in GitHub Desktop.
Save michalbcz/1305912 to your computer and use it in GitHub Desktop.
copy and flatten directories with pictures and zip it to single file as I am lame in Krusader file manager :)
def ant = new AntBuilder() /* rules */
/* copy my roadtrip pictures and videos from CD and flatten it */
ant.copy(todir: "/home/michal/Pictures/Norsko2004", flatten: true /* if false (default) it copies directory structure too */) {
fileset(dir:"/media/Norsko 2004/Norsko 2004", casesensitive: false) {
include(name: "**/*.jpg") /* pictures... */
include(name: "**/*.mov") /* ...and videos */
}
}
/* then zip it all to single file */
ant.zip(basedir:"/home/michal/Pictures/Norsko2004", destfile:"/home/michal/Pictures/Norsko2004/norsko2004.zip")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment