Skip to content

Instantly share code, notes, and snippets.

@twolfson
Last active January 5, 2016 21:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/4526992 to your computer and use it in GitHub Desktop.
Save twolfson/4526992 to your computer and use it in GitHub Desktop.
Download and unzip Twitter Bootstrap in one fell swoop with grunt
module.exports = function (grunt) {
// Initial configuration
grunt.initConfig({
// Download external resources
curl: {
// Twitter Bootstrap
bootstrap: {
src: 'http://twitter.github.com/bootstrap/assets/bootstrap.zip',
dest: 'tmp/bootstrap.zip'
}
},
// Unzip resources
unzip: {
// Twitter Bootstrap
bootstrap: {
src: '<config:curl.bootstrap.dest>',
dest: 'public'
}
}
});
// Load in grunt-curl and grunt-zip
grunt.loadNpmTasks('grunt-curl');
grunt.loadNpmTasks('grunt-zip');
// Create a task to update Twitter Bootstrap
grunt.registerTask('update-bootstrap', 'curl:bootstrap unzip:bootstrap')
// Default task is to update Twitter Bootstrap
grunt.registerTask('default', 'update-bootstrap')
};
{
"name": "gist-4526992",
"description": "Download and unzip Twitter Bootstrap in one fell swoop with grunt",
"version": "0.1.0",
"homepage": "https://gist.github.com/4526992",
"author": {
"name": "Todd Wolfson",
"email": "todd@twolfson.com",
"url": "http://twolfson.com/"
},
"repository": {
"type": "git",
"url": "Download and unzip Twitter Bootstrap in one fell swoop with grunt"
},
"licenses": [
{
"type": "MIT",
"url": "/blob/master/LICENSE-MIT"
}
],
"main": "lib/gist-4526992",
"engines": {
"node": ">= 0.6.0"
},
"devDependencies": {
"grunt": "~0.3.17",
"grunt-curl": "~0.2.0",
"grunt-zip": "~0.2.0"
},
"keywords": [
"twitter",
"bootstrap",
"download",
"extract",
"automatic",
"grunt"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment