Skip to content

Commit

Permalink
gulp 4 migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
ikenfin committed Apr 16, 2020
1 parent 3cd9788 commit 75e7a0b
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const gulp = require('gulp'),

const NAME = 'foc_add2cart_box';

gulp.task('mktest', () => {
gulp.src('./upload/**')
.pipe(gulp.dest('../oc2/'));
});
function copyToTest () {
return gulp.src('./upload/**')
.pipe(gulp.dest('../oc2/'));
}

gulp.task('build-oc2', () => {
gulp
function buildOc2 () {
return gulp
.src([
'./install.oc2.xml',
'./upload/**/controller/**',
Expand All @@ -25,29 +25,31 @@ gulp.task('build-oc2', () => {
}))
.pipe(zip(`${NAME}-oc2.ocmod.zip`))
.pipe(gulp.dest('./'))
});
}

gulp.task('build-oc3', () => {
gulp.src([
'./install.oc3.xml',
'./upload/**/controller/**',
'./upload/**/model/**',
'./upload/**/language/**',
'./upload/**/view/**/*.twig'
], {base: '.'})
function buildOc3 () {
return gulp.src([
'./install.oc3.xml',
'./upload/**/controller/**',
'./upload/**/model/**',
'./upload/**/language/**',
'./upload/**/view/**/*.twig'
], {base: '.'})
.pipe(rename((file) => {
if (file.dirname == '.' && file.extname == '.xml') {
file.basename = 'install'
}
}))
.pipe(zip(`${NAME}-oc3.ocmod.zip`))
.pipe(gulp.dest('./'))
});
}

gulp.task('build-all', ['build-oc2', 'build-oc3'], () => {});
function startWatcher () {
return gulp.watch('./upload/**', copyToTest)
}

gulp.task('default', ['mktest'], () => {
gulp.watch('./upload/**', () => {
gulp.start('mktest');
});
});
gulp.task('mktest', copyToTest);
gulp.task('build-oc2', buildOc2);
gulp.task('build-oc3', buildOc3);
gulp.task('build-all', gulp.parallel(buildOc2, buildOc3))
gulp.task('default', gulp.series(copyToTest, startWatcher));

0 comments on commit 75e7a0b

Please sign in to comment.