Permalink
Browse files

correct make output

  • Loading branch information...
1 parent 923bf49 commit 30b9d0f16ea96c6f0babb9f26509294189cbc7a1 @maxogden committed Jul 14, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 support/build.js
View
16 support/build.js
@@ -48,7 +48,11 @@ function build(name, fn) {
// javascript
var js = path.join(lib, name, name + '.js');
read(js, function(err, js) {
- if (err) return fn()
+ function done() {
+ console.log(' \033[90mbuild \033[36m%s\033[m', name);
+ fn()
+ }
+ if (err) return done()
// with template
var template = path.join(lib, name, name + '.html');
@@ -57,20 +61,14 @@ function build(name, fn) {
js = '\n;(function(exports, template){\n'
+ js
+ '\n})(' + namespace + ', ' + JSON.stringify(template) + ');';
- append(jsOutput, js, function(){
- console.log(' \033[90mbuild \033[36m%s\033[m', name);
- fn();
- });
+ append(jsOutput, js, done);
});
// without template
} else {
js = '\n;(function(exports){\n'
+ js
+ '\n})(' + namespace + ');';
- append(jsOutput, js, function(){
- console.log(' \033[90mbuild \033[36m%s\033[m', name);
- fn();
- });
+ append(jsOutput, js, done);
}
});

0 comments on commit 30b9d0f

Please sign in to comment.