diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 48906b213..35d3bc6a7 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -2,16 +2,13 @@ ### Version 2.1.9 - Feb 15, 2016 + **Bugs** -**Dropdown** - Fixed issue where dropdowns with sub-menus would not properly activate on mobile #3183 -**API** - Fixes bug where `beforeSend` would not correctly cancel request when `return false;` is used in callback. #3660 -**Enhancements** - - - ### Version 2.1.8 - Jan 7, 2016 **Critical Fix** diff --git a/semantic.json.example b/semantic.json.example index 39f4bfeb2..6d67666e5 100644 --- a/semantic.json.example +++ b/semantic.json.example @@ -18,6 +18,7 @@ }, "permission" : false, + "autoInstall": false, "rtl": false } diff --git a/tasks/config/project/install.js b/tasks/config/project/install.js index c42af2412..20e117bd2 100644 --- a/tasks/config/project/install.js +++ b/tasks/config/project/install.js @@ -82,6 +82,14 @@ module.exports = { return when.hasConfig(); }, + // detect whether there is a semantic.json configuration and that the auto-install option is set to true + shouldAutoInstall: function() { + var + config = when.hasConfig() + ; + return config['autoInstall']; + }, + // checks if files are in a PM directory getPackageManager: function(directory) { var @@ -751,17 +759,5 @@ module.exports = { } } - }, - - // Detect whether there is a semantic.json configuration and that the auto-install option is set to True - // Returns the semantic.json configuration - autoInstall: function() { - var config = when.hasConfig(); - if (config && config['auto-install']) { - return when.hasConfig(); - } else { - return false; - } } - }; diff --git a/tasks/install.js b/tasks/install.js index c18fee19b..f1d822bb0 100644 --- a/tasks/install.js +++ b/tasks/install.js @@ -192,15 +192,20 @@ if(manager.name == 'NPM') { gulp.task('run setup', function() { // If auto-install is switched on, we skip the configuration section and simply reuse the configuration from semantic.json - if (install.autoInstall()) { - answers = install.autoInstall(); - } else { + if(install.shouldAutoInstall()) { + answers = { + overwrite : 'yes', + install : 'auto', + }; + } + else { return gulp - .src('gulpfile.js') - .pipe(prompt.prompt(questions.setup, function(setupAnswers) { - // hoist - answers = setupAnswers; - })); + .src('gulpfile.js') + .pipe(prompt.prompt(questions.setup, function(setupAnswers) { + // hoist + answers = setupAnswers; + })) + ; } }); @@ -214,9 +219,13 @@ gulp.task('create install files', function(callback) { if(answers.overwrite !== undefined && answers.overwrite == 'no') { return; } - console.clear(); - console.log('Installing'); + if(install.shouldAutoInstall()) { + console.log('Auto-Installing (Without User Interaction)'); + } + else { + console.log('Installing'); + } console.log('------------------------------'); @@ -418,19 +427,21 @@ gulp.task('clean up install', function() { } // If auto-install is switched on, we skip the configuration section and simply build the dependencies - if (install.autoInstall()) { + if(install.shouldAutoInstall()) { return gulp.start('build'); - } else { + } + else { return gulp - .src('gulpfile.js') - .pipe(prompt.prompt(questions.cleanup, function(answers) { - if(answers.cleanup == 'yes') { - del(install.setupFiles); - } - if(answers.build == 'yes') { - gulp.start('build'); - } - })); + .src('gulpfile.js') + .pipe(prompt.prompt(questions.cleanup, function(answers) { + if(answers.cleanup == 'yes') { + del(install.setupFiles); + } + if(answers.build == 'yes') { + gulp.start('build'); + } + })) + ; } @@ -443,4 +454,4 @@ runSequence( callback ); -}; \ No newline at end of file +};