Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tidy up make.js output

  • Loading branch information...
commit e86a00ea5be97f1829ccf59dfe028688222bff72 1 parent a7da467
@valueof valueof authored
Showing with 20 additions and 13 deletions.
  1. +20 −13 make.js
View
33 make.js
@@ -1,5 +1,5 @@
#!/usr/bin/env node
-/*global ls:true, target:true, find: true, echo: true, cat:true, exit:true, exec: true */
+/*global ls, target, find, echo, cat, exit, exec, mkdir, test */
"use strict";
@@ -16,9 +16,9 @@ var TESTS = [
var OPTIONS = JSON.parse(cat("./jshint.json"));
target.all = function () {
+ target.build();
target.lint();
target.test();
- target.build();
};
target.lint = function () {
@@ -49,6 +49,7 @@ target.lint = function () {
if (Object.keys(failures).length === 0) {
cli.ok("All files passed.");
+ echo("\n");
return;
}
@@ -93,15 +94,21 @@ target.build = function () {
var bundle = browserify({ debug: true, exports: [ "require" ] });
bundle.addEntry("./src/stable/jshint.js");
- require('fs').mkdir('dist', function () {
- bundle.bundle().to("./dist/jshint.js");
- cli.ok("Bundle");
-
- // Rhino
- var rhino = cat("./dist/jshint.js", "./src/platforms/rhino.js");
- rhino = "#!/usr/bin/env rhino\n\n" + rhino;
- rhino.to("./dist/jshint-rhino.js");
- exec("chmod +x dist/jshint-rhino.js");
- cli.ok("Rhino");
- });
+
+ if (!test("-e", "./dist")) {
+ mkdir("./dist");
+ }
+
+ echo("Building into dist/...", "\n");
+
+ bundle.bundle().to("./dist/jshint.js");
+ cli.ok("Bundle");
+
+ // Rhino
+ var rhino = cat("./dist/jshint.js", "./src/platforms/rhino.js");
+ rhino = "#!/usr/bin/env rhino\n\n" + rhino;
+ rhino.to("./dist/jshint-rhino.js");
+ exec("chmod +x dist/jshint-rhino.js");
+ cli.ok("Rhino");
+ echo("\n");
};
Please sign in to comment.
Something went wrong with that request. Please try again.