Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vladikoff/5970204 to your computer and use it in GitHub Desktop.
Save vladikoff/5970204 to your computer and use it in GitHub Desktop.
grunt.registerTask('taskname', 'My awesome task', function () {
var done = this.async();
// Epic hacks
var grunt = require('grunt');
grunt.task.init = function() {};
grunt.initConfig({
compress: {
target: {
options: {
archive: '../app.zip'
},
files: [
{ src: ['**'] }
]
}
}
});
// you might have to change this, this might be required for `loadNpmTasks`
var cwd = process.cwd();
process.chdir(__dirname + '/..');
grunt.loadNpmTasks('grunt-contrib-compress');
process.chdir(cwd);
// Finally run the tasks, with options and a callback when we're done
grunt.tasks(['compress'], {}, function() {
// compress done running
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment