-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (34 loc) · 1.03 KB
/
gulpfile.js
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
30
31
32
33
34
35
36
37
var gulp = require('gulp');
var zip = require('gulp-zip');
var paths = {
html: 'src',
public: 'assets',
backup: 'backup',
};
//Create backup zip file
gulp.task('backup', function () {
Date.prototype.yyyymmdd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
var hh = this.getHours().toString();
return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]) + '-' + hh;
};
var date = new Date();
var filename = 'fluidform-source-'+ date.yyyymmdd() + '.zip';
return gulp.src([
paths.html + '/**/*.*',
'android',
'ios',
'gulpfile.js',
'package.json',
'index.js',
'metro.config.js',
'babel.config.js',
'app.json',
'App.js',
'.prettierrc.js'
], {base: './'})
.pipe(zip(filename))
.pipe(gulp.dest(paths.backup))
});