Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Commit

Permalink
allow rec and flat flags to be overwritten by pkg.json in build.js
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Dec 1, 2014
1 parent f686f1b commit 2f29200
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
11 changes: 7 additions & 4 deletions js/dist/pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


var build = function(opt){

var fs = require('fs');
var util = require('util');
var fmt = util.format;
Expand All @@ -19,15 +19,17 @@ var build = function(opt){
ns : undefined,
src : undefined,
out : undefined,
base : 0
base : 0,
rec : false,
flat : true
};

opt = extend({}, dflt, opt);

var recbuild = recbuild_t({
name : opt.ns,
rec : false,
flat : true
rec : opt.rec,
flat : opt.flat
});

if (!fs.existsSync(opt.out)) fs.mkdirSync(opt.out);
Expand Down Expand Up @@ -62,6 +64,7 @@ var build = function(opt){
};

exports.build = build;

/* js/src/config.js */

exports.config = 'pkg.json';
Expand Down
2 changes: 1 addition & 1 deletion js/dist/pkg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/pkg.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions js/src/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


var build = function(opt){

var fs = require('fs');
var util = require('util');
var fmt = util.format;
Expand All @@ -13,15 +13,17 @@ var build = function(opt){
ns : undefined,
src : undefined,
out : undefined,
base : 0
base : 0,
rec : false,
flat : true
};

opt = extend({}, dflt, opt);

var recbuild = recbuild_t({
name : opt.ns,
rec : false,
flat : true
rec : opt.rec,
flat : opt.flat
});

if (!fs.existsSync(opt.out)) fs.mkdirSync(opt.out);
Expand Down Expand Up @@ -55,4 +57,4 @@ var build = function(opt){

};

exports.build = build;
exports.build = build;

0 comments on commit 2f29200

Please sign in to comment.