Skip to content

Commit

Permalink
Update to use new gulp api
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSurabian committed Sep 9, 2018
1 parent a99f98b commit b29419a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var glob = require('glob');
var shell = require('gulp-shell');
var fs = require('fs');

gulp.task('audio', function() {
gulp.task('audio', gulp.parallel(function() {
var files = glob.sync('./src/assets/sounds/*.mp3');
var outputPath = './dist/audio';
var opts = {
Expand All @@ -22,28 +22,28 @@ gulp.task('audio', function() {

return fs.writeFile('./dist/audio' + '.json', JSON.stringify(obj, null, 2));
});
});
}));

gulp.task('images', function(){
gulp.task('images', gulp.parallel(function(){
// There is a texturepacker template for spritesmith but it doesn't work
// well with complex directory structures, so instead we use the shell
// checking TexturePacker --version first ensures it bails if TexturePacker
// isn't installed
return gulp.src('', {read:false})
return gulp.src('*', {read:false})
.pipe(shell([
'TexturePacker --version || echo ERROR: TexturePacker not found, install TexturePacker',
'TexturePacker --disable-rotation --data dist/sprites.json --format json --sheet dist/sprites.png src/assets/images'
]))
.pipe(connect.reload());
});
}));

gulp.task('deploy', function() {
return gulp.src('', {read:false})
gulp.task('deploy', gulp.parallel(function() {
return gulp.src('*', {read:false})
.pipe(shell([
'AWS_PROFILE=duckhunt terraform plan',
'AWS_PROFILE=duckhunt terraform apply',
'aws --profile duckhunt s3 sync dist/ s3://duckhuntjs.com --include \'*\' --acl \'public-read\''
]));
});
}));

gulp.task('default', ['images', 'audio']);
gulp.task('default', gulp.parallel('images', 'audio'));

0 comments on commit b29419a

Please sign in to comment.