forked from fitzgen/wu.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJakefile
38 lines (32 loc) · 990 Bytes
/
Jakefile
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
var JAKE = require("jake");
var OS = require("os");
var FILE = require("file");
JAKE.task("minify", function () {
OS.system("java -jar build/google-compiler-20091218.jar --js lib/wu.js > wu.min.js");
});
JAKE.task("test-min", ["minify"], function () {
var f = FILE.open("test/wu.tests.min.html", "w");
f.write(
FILE.open("test/wu.tests.html", "r")
.read()
.replace("../lib/wu.js", "../wu.min.js")
);
f.close();
});
JAKE.task("clean", function () {
FILE.remove("wu.min.js");
FILE.remove("test/wu.tests.min.html");
});
JAKE.task("npm-publish", function () {
var dirtyIndex = false;
if ( OS.popen("git status").stdout.read().match(/modified: /) !== null ) {
dirtyIndex = true;
OS.system("git stash");
}
FILE.remove("./build/google-compiler-20091218.jar");
OS.system("sudo npm publish .");
OS.system("git reset --hard");
if (dirtyIndex) {
OS.system("git stash pop");
}
});