-
Notifications
You must be signed in to change notification settings - Fork 361
Expand file tree
/
Copy pathbuild
More file actions
executable file
·32 lines (26 loc) · 824 Bytes
/
build
File metadata and controls
executable file
·32 lines (26 loc) · 824 Bytes
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
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
var browserify = require("browserify");
var bundle = browserify("./src/jshint.js");
var version = require("../package.json").version;
require("shelljs/make");
if (!test("-e", "../dist"))
mkdir("../dist");
bundle.require("./src/jshint.js", { expose: "jshint" });
bundle.bundle({}, function (err, src) {
var web = "./dist/jshint-" + version + ".js";
var rhino = "./dist/jshint-rhino-" + version + ".js";
[ "// " + version,
"var JSHINT;",
"var window;",
"if (typeof window === 'undefined') window = {};",
"(function () {",
"var require;",
src,
"JSHINT = require('jshint').JSHINT;",
"}());"
].join("\n").to(web);
("#!/usr/bin/env rhino\nvar window = {};\n" + cat(web, "./src/platforms/rhino.js")).to(rhino);
chmod("+x", rhino);
});