How to use the option function from grunt
Find comprehensive JavaScript grunt.option code examples handpicked from public code repositorys.
GitHub: maxov/gulp-grunt
13 14 15 16 17 18 19 20 21
if (options) { for (var key in options) { baseOptions[key] = options[key]; if(key != 'base' && key != 'prefix'){ grunt.option(key, options[key]); } } }
22
167
4
132 133 134 135 136 137 138 139 140 141
// node_configs/connect.js 'use strict'; var grunt = require('grunt') module.exports = { options: { port: grunt.option('port') || 9001 }, server: { // ... }
1
3
3
5 6 7 8 9 10 11 12 13 14
var Helpers = {}; var base = process.cwd(); var glob = require('glob'); /* Overwrite browser env variables if grunt options are set */ var browsers = grunt.option('browser') || grunt.option('browsers'); if (browsers) { process.env.KARMA_BROWSERS = browsers; process.env.PROTRACTOR_BROWSERS = browsers; }
45
1
31
GitHub: brandung/capitan
6 7 8 9 10 11 12 13 14 15
* - the template string is set by the prompt:init task */ var grunt = require('grunt'), Helpers = require('../helpers'), component = grunt.option('name') || ''; module.exports = { init: { src: [
2
16
18
GitHub: brandung/capitan
2 3 4 5 6 7 8 9 10 11
* * https://www.npmjs.com/package/grunt-file-creator */ var grunt = require('grunt'), component = grunt.option('name') || '', date = new Date().toISOString().substring(0, 10); module.exports = { componentFiles: [
2
16
18
GitHub: ejcarranzap/worldvision
200 201 202 203 204 205 206 207 208 209
createKarmangularConfig: function() { if (grunt.option('fast')){ var versions = [util.latestAngular()]; } else { // For each file found, make sure it's a directory... var versions = grunt.option('angular') ? grunt.option('angular').split(/,/) : null || util.angulars(); } if (grunt.option('angular')) { if (grunt.option('angular') === 'latest') {
0
1
0
+ 13 other calls in file
168 169 170 171 172 173 174 175 176 177
// The main grunt task */ grunt.registerTask('nsp-audit', 'Audits package.json against nodesecurity.io API', function () { var done = this.async(), config = makeConfig(grunt.config.get('nsp-audit')), file = grunt.option('nsp-file'); if (file) { config.files = [file]; }
0
0
3
+ 15 other calls in file
GitHub: angular-ui/ui-grid
179 180 181 182 183 184 185 186 187 188
if (grunt.option('fast')){ versions = [util.latestAngular()]; } else { // For each file found, make sure it's a directory... versions = grunt.option('angular') ? grunt.option('angular').split(/,/) : null || util.angulars(); } if (grunt.option('angular')) { if (grunt.option('angular') === 'latest') {
0
0
363
+ 27 other calls in file
13 14 15 16 17 18 19 20 21
console.log("update/tasks/wordpressupdate.js"); grunt.registerTask('pull_site', 'pulls the files and DB from the remote server', function() { var target = grunt.option('target') || task_options['target']; if ( typeof target === "undefined" || typeof grunt.config.get('wordpressdeploy')[target] === "undefined" || target === "local") { grunt.fail.warn("Invalid target specified. Did you pass the wrong argument? Please check your task configuration.", 6); }
0
0
1
grunt.file is the most popular function in grunt (372 examples)