Skip to content

Instantly share code, notes, and snippets.

@mikehostetler
Created October 21, 2012 18:48
Show Gist options
  • Save mikehostetler/3928066 to your computer and use it in GitHub Desktop.
Save mikehostetler/3928066 to your computer and use it in GitHub Desktop.
// Run all the things...
run: function( done ) {
// Ensure build path exists
anvil.fs.ensurePath( this.config.buildPath , function ( err ) {
if( err ) {
anvil.log.error( err );
done();
}
});
var zip = new AdmZip(),
outputPath = fs.realpathSync( this.config.buildDir );
anvil.log.event( "**** Zipping the contents of " + anvil.config.output );
anvil.log.event( "**** OUTPUT PATH " + anvil.fs.buildPath(anvil.config.output) );
anvil.log.event( "**** BUILD PATH " + fs.realpathSync( this.config.buildDir ) );
outputPath = fs.realpathSync( this.config.buildDir );
anvil.fs.getFiles(anvil.config.output,anvil.config.output,
function(files, directories) {
_.each(files, function(val) {
anvil.log.debug("Adding " + val.fullPath);
zip.addLocalFile(val.fullPath);
});
_.each(directories, function(val) {
anvil.log.debug("Adding " + val);
zip.addLocalFolder(val);
});
}, [], 0);
anvil.log.step("Write the zip file!")
//zip.writeZip( "/Users/mikehostetler/Source/client-rim-jqm-demo/htdocs/build/build.zip" );
done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment