Skip to content

Commit 9d4b275

Browse files
committed
Fix install callbacks
1 parent 8572857 commit 9d4b275

2 files changed

Lines changed: 25 additions & 22 deletions

File tree

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"map-stream": "*",
4545
"replace-ext": "*",
4646
"require-dot-file": "*",
47-
"run-sequence": "*",
4847
"yamljs": "*"
4948
},
5049
"dependencies": {
@@ -72,15 +71,13 @@
7271
"gulp-replace": "^1.0.0",
7372
"gulp-rtlcss": "^1.4.1",
7473
"gulp-uglify": "^3.0.2",
75-
"gulp4-run-sequence": "^1.0.1",
7674
"jquery": "^3.5.1",
7775
"map-stream": "^0.1.0",
7876
"merge-stream": "^1.0.0",
7977
"mkdirp": "^1.0.4",
8078
"prompt-sui": "^3.2.1",
8179
"replace-ext": "^1.0.1",
8280
"require-dot-file": "^0.4.0",
83-
"run-sequence": "^2.2.1",
8481
"wrench-sui": "^0.0.3",
8582
"yamljs": "^0.3.0"
8683
},

tasks/install.js

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ let
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

@@ -45,6 +43,8 @@ let
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

Comments
 (0)