Permalink
Browse files

#3616 Adds autoInstall option to semantic.json, modifies installer to…

… return correct questions object in autoinstall
  • Loading branch information...
1 parent 33381f5 commit 487c5cce539acee90ac5f56303a497cf874c0017 @jlukic jlukic committed Feb 15, 2016
Showing with 43 additions and 38 deletions.
  1. +1 −4 RELEASE-NOTES.md
  2. +1 −0 semantic.json.example
  3. +8 −12 tasks/config/project/install.js
  4. +33 −22 tasks/install.js
View
@@ -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**
@@ -18,6 +18,7 @@
},
"permission" : false,
+ "autoInstall": false,
"rtl": false
}
@@ -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;
- }
}
-
};
View
@@ -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
);
-};
+};

0 comments on commit 487c5cc

Please sign in to comment.