Last active
February 10, 2024 23:57
-
-
Save gladius882/a52e4bbfb7c5a9c8fabfc6b883dc5c9b to your computer and use it in GitHub Desktop.
gulp tasks for prestashop module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import zip from 'gulp-zip'; | |
import { exec } from 'child_process' | |
import pkg from './package.json' assert {type: 'json'} | |
gulp.task('headers', function(done) { | |
exec('php .\vendor\bin\header-stamp --exclude=vendor,node_modules,dist', (error, stdout, stderr) => { | |
if(error) { | |
console.error('exec error: ' + stderr); | |
return; | |
} | |
console.log('stdout: ' + stdout); | |
console.error('stderr: ' + stderr); | |
}); | |
done(); | |
}); | |
gulp.task('build', function(done) { | |
exec('php ./vendor/bin/php-cs-fixer fix .', (error, stdout, stderr) => { | |
if(error) { | |
console.error('exec error: ' + stderr); | |
return; | |
} | |
console.log('stdout: ' + stdout); | |
console.error('stderr: ' + stderr); | |
gulp.src([ | |
'.htaccess', | |
'config.xml', | |
'*.php', | |
'sql/**/*', | |
'translations/**/*', | |
'upgrade/**/*', | |
'views/**/*' | |
], {base: '../'}) | |
.pipe(zip(pkg.name + '.zip')) | |
.pipe(gulp.dest('dist')); | |
}) | |
done(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment