Skip to content
This repository
Browse code

Tidy up make.js output

  • Loading branch information...
commit e86a00ea5be97f1829ccf59dfe028688222bff72 1 parent a7da467
Anton Kovalyov authored December 31, 2012

Showing 1 changed file with 20 additions and 13 deletions. Show diff stats Hide diff stats

  1. 33  make.js
33  make.js
... ...
@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/env node
2  
-/*global ls:true, target:true, find: true, echo: true, cat:true, exit:true, exec: true */
  2
+/*global ls, target, find, echo, cat, exit, exec, mkdir, test */
3 3
 
4 4
 "use strict";
5 5
 
@@ -16,9 +16,9 @@ var TESTS = [
16 16
 var OPTIONS = JSON.parse(cat("./jshint.json"));
17 17
 
18 18
 target.all = function () {
  19
+	target.build();
19 20
 	target.lint();
20 21
 	target.test();
21  
-	target.build();
22 22
 };
23 23
 
24 24
 target.lint = function () {
@@ -49,6 +49,7 @@ target.lint = function () {
49 49
 
50 50
 	if (Object.keys(failures).length === 0) {
51 51
 		cli.ok("All files passed.");
  52
+		echo("\n");
52 53
 		return;
53 54
 	}
54 55
 
@@ -93,15 +94,21 @@ target.build = function () {
93 94
 	var bundle = browserify({ debug: true, exports: [ "require" ] });
94 95
 
95 96
 	bundle.addEntry("./src/stable/jshint.js");
96  
-	require('fs').mkdir('dist', function () {
97  
-		bundle.bundle().to("./dist/jshint.js");
98  
-		cli.ok("Bundle");
99  
-
100  
-		// Rhino
101  
-		var rhino = cat("./dist/jshint.js", "./src/platforms/rhino.js");
102  
-		rhino = "#!/usr/bin/env rhino\n\n" + rhino;
103  
-		rhino.to("./dist/jshint-rhino.js");
104  
-		exec("chmod +x dist/jshint-rhino.js");
105  
-		cli.ok("Rhino");
106  
-	});
  97
+
  98
+	if (!test("-e", "./dist")) {
  99
+		mkdir("./dist");
  100
+	}
  101
+
  102
+	echo("Building into dist/...", "\n");
  103
+
  104
+	bundle.bundle().to("./dist/jshint.js");
  105
+	cli.ok("Bundle");
  106
+
  107
+	// Rhino
  108
+	var rhino = cat("./dist/jshint.js", "./src/platforms/rhino.js");
  109
+	rhino = "#!/usr/bin/env rhino\n\n" + rhino;
  110
+	rhino.to("./dist/jshint-rhino.js");
  111
+	exec("chmod +x dist/jshint-rhino.js");
  112
+	cli.ok("Rhino");
  113
+	echo("\n");
107 114
 };

0 notes on commit e86a00e

Please sign in to comment.
Something went wrong with that request. Please try again.