From b009b3ee8bf71d1d75442f9471eb54f5ff89b7c4 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Sat, 22 Jul 2017 12:49:54 +0700 Subject: [PATCH] Gulpfile fixes --- Gulpfile.coffee | 29 ++++++++++++++++++++--------- build/game/.blankfile | 0 dist/game/.blankfile | 0 img/double-face-mask.png | Bin 1084 -> 0 bytes 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 build/game/.blankfile create mode 100644 dist/game/.blankfile delete mode 100644 img/double-face-mask.png diff --git a/Gulpfile.coffee b/Gulpfile.coffee index 2c28186..61d8bc7 100644 --- a/Gulpfile.coffee +++ b/Gulpfile.coffee @@ -30,9 +30,18 @@ audio = (target) -> return () -> return gulp.src(['audio/*.mp3']).pipe(gulp.dest(target)) +translations = (target) -> + if !fs.existsSync(target+'/translations') + fs.mkdirSync(target+'/translations') + for language in ['ru', 'en'] + data = CSON.parseCSONFile('game/translations/'+language+'.cson') + json = JSON.stringify(data) + '\n' + fs.writeFileSync(target+"/translations/"+language+".json", json) + gulp.task('html', html('./build')) gulp.task('img', img('./build/img')) gulp.task('audio', audio('./build/audio')) +gulp.task('translations', translations('./build/game')) # SCSS styles gulp.task('sass', () -> @@ -42,13 +51,6 @@ gulp.task('sass', () -> ) gulp.task('concatCoffee', () -> - if !fs.existsSync('./build/game/translations') - fs.mkdirSync('./build/game/translations') - for language in ['ru', 'en'] - data = CSON.parseCSONFile('game/translations/'+language+'.cson') - json = JSON.stringify(data) + '\n' - fs.writeFileSync("./build/game/translations/"+language+".json", json) - gulp.src([ ## additional functions ## the actual game @@ -64,7 +66,14 @@ gulp.task('coffee', ['concatCoffee'], () -> .pipe(gulp.dest('./build/game/')) ) -gulp.task('build', ['html', 'img', 'sass', 'coffee', 'audio']) +gulp.task('build', [ + 'html', + 'img', + 'sass', + 'coffee', + 'audio', + 'translations' +]) gulp.task('serve', ['build'], () -> browserSync({ @@ -97,6 +106,7 @@ gulp.task('legal-dist', () -> return gulp.src(['LICENSE.txt']) .pipe(gulp.dest("./dist")) ) +gulp.task('translations-dist', translations('./dist/game')) gulp.task('sass-dist', () -> return gulp.src('./sass/main.scss') @@ -118,7 +128,8 @@ gulp.task('dist', [ 'sass-dist', 'coffee-dist', 'audio-dist', - 'legal-dist' + 'legal-dist', + 'translations-dist' ]) gulp.task('zip', ['dist'], () -> diff --git a/build/game/.blankfile b/build/game/.blankfile new file mode 100644 index 0000000..e69de29 diff --git a/dist/game/.blankfile b/dist/game/.blankfile new file mode 100644 index 0000000..e69de29 diff --git a/img/double-face-mask.png b/img/double-face-mask.png deleted file mode 100644 index e6e1a0af6974f6b487864a5e27020da47ee02c0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1084 zcmV-C1jGA@P)HBPNCME+r1IWN3ED6}Y2~f2OK#>6%_)Y@sk^lt}0132s=s$JO>`s-d ze0#cEM@Q0;1^{;i;Gp(D?qdz)?sDoo!0UU)Lip_h6xOD*Wy|=j_Tz9VF7V^w#ju%O z!Cn*TsjYcE`&GaP(9?SHcz~r|*dIlPkZwY`ILc=(mxp*3nuF#4aJTBBmqkCJs@&2p zSuewJA$CC)%0iChus!$vHGJKP2Hstan1>79M=sQj-a*c^IW9>%C`)7&r!!LCHl7b) zgRMbleAx_zchOi+umD!lE*0-3IVw?;@C!W527_~BeNGsb_=iNC4>}b9yHpGcGHT%< z3;jOsIp){$_*xOi>hM~s_0Jtix*;-BMid~zC1pu@gJ(i{d(VNgR%*PL&H{+pI6*6# zMo78|Tq3JN6U8`%g+CjUJ+uRmPt-&Zy&^)^p5=$c4)RKU<0q>mqf2Bie0SixRLGLm zCt}nppp|M1Rog4+MvHyTgQ5#$BuC0-e2TOW$Ci?q)TBGZ$ofoY5`IxsaEj$*^4fQL#!XfFv^O0g&*xiaDf z7@iW3gZ*C0A)ZS(E|<##(mU`jcsKYdC7#A55rDi(aYpPIA5-Fyl%7cG3HXvokKfRM zKzDl*PgL}jB&!K!zbyNAC^EdUJ&&Feq*wY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