-
Notifications
You must be signed in to change notification settings - Fork 195
/
Copy pathgulpfile.js
76 lines (64 loc) · 1.92 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var gulp = require('gulp');
var git = require('gulp-git');
var runSequence = require('run-sequence');
var bump = require('gulp-bump');
var replace = require('gulp-replace');
gulp.task('x_bump', function(){
gulp.src('./package.json')
.pipe(bump({type:'PATCH', indent: 4 }))
.pipe(gulp.dest('./'));
});
gulp.task('cssDev', function(){
gulp.src(['src/styles/style.css'])
.pipe(replace(/\/\*\*dev_mode_start\*\*\/[^]+\/\*\*dev_mode_end\*\*\//gim, cssDev))
.pipe(gulp.dest('src/styles/'));
});
gulp.task('cssRelease', function(){
gulp.src(['src/styles/style.css'])
.pipe(replace(/\/\*\*dev_mode_start\*\*\/[^]+\/\*\*dev_mode_end\*\*\//gim, cssRelease))
.pipe(gulp.dest('src/styles/'));
});
/** Dangerous, this will wipe your current source and sync with GitHub **/
gulp.task('vanish***', function (done) {
var c = 8;
console.log('Starting in ' + c + ' seconds');
var handler = setInterval(function () {
c--;
console.log('syncing in ---> ' + c);
if (c == 0) {
clearInterval(handler);
console.log('sync');
runSequence('x_gitReset', 'x_gitPull', done);
}
}, 1000)
});
gulp.task('x_gitPull', function () {
git.exec({args: '-c core.quotepath=false pull --progress --no-stat -v --progress origin master'}, function (err, stdout) {
if (err) throw err;
});
});
gulp.task('x_gitReset', function () {
git.exec({args: '-c core.quotepath=false reset --hard HEAD --'}, function (err, stdout) {
if (err) throw err;
});
});
var cssRelease = `/**dev_mode_start**/
small.debug {
color: red;
display: none !important;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
}
/**dev_mode_end**/`;
var cssDev = `/**dev_mode_start**/
small.debug {
color: red;
}
small.release {
text-transform: lowercase;
color: #4c4c4c;
display: none !important;
}
/**dev_mode_end**/`;