forked from standardshub/oma-tools-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
76 lines (62 loc) · 1.8 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 runSequence = require('run-sequence');
var git = require('gulp-git');
var watch = require('gulp-watch');
var rjs = require('gulp-requirejs');
var sass = require('gulp-sass');
gulp.task('build-profile', function() {
gulp.src('oma-profile/oma.scss.css')
.pipe(sass())
.pipe(gulp.dest('./build/'));
rjs({
baseUrl: "./oma-profile"
, optimize: "none"
, paths: {
requireLib: "../node_modules/requirejs/require",
domReady: "../node_modules/respec/js/domReady",
core: "../node_modules/respec/js/core/",
text: "../node_modules/respec/js/text",
tmpl: "../node_modules/respec/js/tmpl",
handlebars: "../node_modules/respec/js/handlebars",
shortcut: "../node_modules/respec/js/shortcut",
webidl2: "../node_modules/respec/js/webidl2",
w3c: "../node_modules/respec/js/w3c"
}
, shim: {
"shortcut": {
exports: "shortcut"
}
}
, name: "oma"
, include: "requireLib".split(" ")
, out: "test-b.js"
, inlineText: true
, preserveLicenseComments: false
}).pipe(gulp.dest('./build/'));
});
gulp.task('watch', function() {
gulp.watch('**', ['build-profile']);
});
gulp.task('publish', function(callback) {
runSequence('checkout', 'merge', 'push', 'cleanup', callback);
});
gulp.task('checkout', function() {
git.checkout('gh-pages', function (err) {
if (err) throw err;
});
});
gulp.task('merge', function() {
git.merge('master', function(err) {
if (err) throw err;
});
});
gulp.task('push', function() {
git.push('origin', 'gh-pages', function(err) {
if (err) throw err;
});
});
gulp.task('cleanup', function() {
git.checkout('master', function(err) {
if (err) throw err;
});
});