Skip to content

Instantly share code, notes, and snippets.

@gladius882
Last active February 10, 2024 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladius882/a52e4bbfb7c5a9c8fabfc6b883dc5c9b to your computer and use it in GitHub Desktop.
Save gladius882/a52e4bbfb7c5a9c8fabfc6b883dc5c9b to your computer and use it in GitHub Desktop.
gulp tasks for prestashop module
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