3434 requireDotFile = require ( 'require-dot-file' ) ,
3535 wrench = require ( 'wrench-sui' ) ,
3636
37- runSequence = require ( 'gulp4-run-sequence' ) ,
38-
3937 // install config
4038 install = require ( './config/project/install' ) ,
4139
4543 // release config (name/title/etc)
4644 release = require ( './config/project/release' ) ,
4745
46+ { series, parallel, task} = gulp ,
47+
4848 // shorthand
4949 questions = install . questions ,
5050 files = install . files ,
@@ -190,7 +190,7 @@ installer = function (callback) {
190190 Create SUI
191191 ---------------*/
192192
193- gulp . task ( 'run setup' , function ( ) {
193+ task ( 'run setup' , function ( ) {
194194
195195 // If auto-install is switched on, we skip the configuration section and simply reuse the configuration from semantic.json
196196 if ( install . shouldAutoInstall ( ) ) {
@@ -212,14 +212,15 @@ installer = function (callback) {
212212 }
213213 } ) ;
214214
215- gulp . task ( 'create install files' , function ( callback ) {
215+ task ( 'create install files' , function ( callback ) {
216216
217217 /*--------------
218218 Exit Conditions
219219 ---------------*/
220220
221221 // if config exists and user specifies not to proceed
222222 if ( answers . overwrite !== undefined && answers . overwrite == 'no' ) {
223+ callback ( ) ;
223224 return ;
224225 }
225226 console . clear ( ) ;
@@ -349,7 +350,7 @@ installer = function (callback) {
349350 Theme Config
350351 ---------------*/
351352
352- gulp . task ( 'create theme.config' , function ( ) {
353+ task ( 'create theme.config' , function ( ) {
353354 let
354355 // determine path to site theme folder from theme config
355356 // force CSS path variable to use forward slashes for paths
@@ -383,7 +384,7 @@ installer = function (callback) {
383384 Semantic.json
384385 ---------------*/
385386
386- gulp . task ( 'create semantic.json' , function ( ) {
387+ task ( 'create semantic.json' , function ( ) {
387388
388389 let
389390 jsonConfig = install . createJSON ( answers )
@@ -393,7 +394,6 @@ installer = function (callback) {
393394 if ( fs . existsSync ( installPaths . config ) ) {
394395 console . info ( 'Extending config file (semantic.json)' , installPaths . config ) ;
395396 return gulp . src ( installPaths . config )
396- . pipe ( plumber ( ) )
397397 . pipe ( rename ( settings . rename . json ) ) // preserve file extension
398398 . pipe ( jsonEditor ( jsonConfig ) )
399399 . pipe ( gulp . dest ( installPaths . configFolder ) )
@@ -411,15 +411,18 @@ installer = function (callback) {
411411
412412 } ) ;
413413
414- runSequence (
415- 'create theme.config' ,
416- 'create semantic.json' ,
417- callback
418- ) ;
414+ series (
415+ task ( 'create theme.config' ) ,
416+ task ( 'create semantic.json' ) ,
417+ function doSetupCallback ( innerCallback ) {
418+ innerCallback ( ) ;
419+ callback ( ) ;
420+ }
421+ ) ( ) ;
419422
420423 } ) ;
421424
422- gulp . task ( 'clean up install' , function ( ) {
425+ task ( 'clean up install' , function ( ) {
423426
424427 // Completion Message
425428 if ( installFolder && ! install . shouldAutoInstall ( ) ) {
@@ -452,12 +455,15 @@ installer = function (callback) {
452455
453456 } ) ;
454457
455- runSequence (
456- 'run setup' ,
457- 'create install files' ,
458- 'clean up install' ,
459- callback
460- ) ;
458+ series (
459+ task ( 'run setup' ) ,
460+ task ( 'create install files' ) ,
461+ task ( 'clean up install' ) ,
462+ function doInstallCallback ( innerCallback ) {
463+ innerCallback ( ) ;
464+ callback ( ) ;
465+ }
466+ ) ( ) ;
461467
462468} ;
463469
0 commit comments