Browse Source

Merge branch 'reinstall-automation' of https://github.com/algorithme/Semantic-UI into next

pull/3704/head
Jack Lukic 8 years ago
parent
commit
33381f581b
2 changed files with 41 additions and 21 deletions
  1. 15
      tasks/config/project/install.js
  2. 47
      tasks/install.js

15
tasks/config/project/install.js

@ -416,7 +416,7 @@ module.exports = {
{
name: 'Yes',
value: true
},
}
]
},
{
@ -730,7 +730,7 @@ module.exports = {
/* Rename Files */
rename: {
json : { extname : '.json' },
json : { extname : '.json' }
},
/* Copy Install Folders */
@ -751,6 +751,17 @@ 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;
}
}
};

47
tasks/install.js

@ -191,14 +191,17 @@ if(manager.name == 'NPM') {
gulp.task('run setup', function() {
return gulp
.src('gulpfile.js')
.pipe(prompt.prompt(questions.setup, function(setupAnswers) {
// hoist
answers = setupAnswers;
}))
;
// 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 {
return gulp
.src('gulpfile.js')
.pipe(prompt.prompt(questions.setup, function(setupAnswers) {
// hoist
answers = setupAnswers;
}));
}
});
gulp.task('create install files', function(callback) {
@ -414,17 +417,23 @@ gulp.task('clean up install', function() {
console.log('');
}
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');
}
}))
;
// If auto-install is switched on, we skip the configuration section and simply build the dependencies
if (install.autoInstall()) {
return gulp.start('build');
} 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');
}
}));
}
});
runSequence(

Loading…
Cancel
Save