-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gruntfile.js
68 lines (54 loc) · 1.44 KB
/
Gruntfile.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
var qsub = require("qsub");
var async = require("async");
var fs = require("fs");
module.exports = function(grunt) {
grunt.registerTask("publish", function() {
var done = this.async();
if (fs.existsSync("doc.zip"))
fs.unlinkSync("doc.zip");
async.series([
function(next) {
var job = qsub("zip");
job.arg("-r", "doc.zip", "doc");
job.expect(0);
job.run().then(next, grunt.fail.fatal);
},
function(next) {
var job = qsub("curl");
job.arg("-s", "-X", "POST");
job.arg("--data-binary", "@doc.zip");
job.arg("http://limikael.altervista.org/?target=pixitextinput&key=ScFVm5gw");
job.expect(0).expectOutput("OK").show();
job.run().then(next, grunt.fail.fatal);
},
function(next) {
fs.unlinkSync("doc.zip");
done();
}
]);
});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
});
grunt.registerTask("doc", function() {
var done = this.async();
var job = qsub("./node_modules/.bin/yuidoc");
job.arg("--configfile", "res/yuidoc.json");
job.show().expect(0);
job.run().then(done, function(e) {
console.log(e);
grunt.fail.fatal(e);
});
});
grunt.registerTask("browserify", function() {
var done = this.async();
var job = qsub("./node_modules/.bin/browserify").arg("-d");
job.arg("-o", "test/textinputtest.bundle.js");
job.arg("test/textinputtest.js");
job.show().expect(0);
job.run().then(done, function(e) {
console.log(e);
throw e;
})
});
}