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 e6e1a0a..0000000 Binary files a/img/double-face-mask.png and /dev/null differ