Gulpfile fixes
This commit is contained in:
parent
cf7c4ea91b
commit
b009b3ee8b
|
@ -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'], () ->
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue