forked from Spb8Lighting/OnyxLuaScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
29 lines (26 loc) · 834 Bytes
/
Copy pathgulpfile.js
File metadata and controls
29 lines (26 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const gulp = require('gulp')
, replace = require('gulp-replace')
, rename = require('gulp-rename')
, merge = require('merge-stream')
, zip = require('gulp-zip')
, fs = require('fs')
gulp.task('build', () => {
return gulp.src('./scripts/*.lua')
.pipe(replace('--##LUAHEADERINCLUDE##--', fs.readFileSync('./assets/header.lua', 'utf8') + "\n"))
.pipe(gulp.dest('./dist/'))
})
gulp.task('release:zip', () => {
fs.unlink('./release/Onyx-Lua-ShowCockpit.zip', () => {
return gulp.src('./dist/**/*')
.pipe(zip('Onyx-Lua-ShowCockpit.zip'))
.pipe(gulp.dest('./release/'))
})
})
// On any modification of dist file
gulp.task('watch', () => {
gulp.watch('./scripts/**/*', ['build'])
gulp.watch('./assets/**/*', ['build'])
})
// Default task when gulp command launched
gulp.task('default', ['build', 'watch'], () => {
})