Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
47 lib/ender.js
@@ -39,7 +39,7 @@ var colors = require('colors')
}
, install: function (file, options, callback) {
- var json = file[0].match(/\.json/) ? '' : '/package.json'
+ var json = file[0] && file[0].match(/\.json/) ? '' : '/package.json'
, location = path.join(process.cwd(), file[0], json)
function build(_data, callback){
@@ -184,14 +184,47 @@ var colors = require('colors')
, analyzePackages
])
+
function analyzePackages(type, activePackages, activeOptions) {
- options = ENDER.util.merge(activeOptions, options)
- activePackages = ENDER.util.unique(activePackages)
+ function printInfo() {
+ options = ENDER.util.merge(activeOptions, options)
+ activePackages = ENDER.util.unique(activePackages)
+
+ async.series([
+ async.apply(ENDER.file.prettyPrintEnderSize, type, options.use)
+ , async.apply(ENDER.npm.prettyPrintDependencies, activePackages)
+ ])
+ }
- async.series([
- async.apply(ENDER.file.prettyPrintEnderSize, type, options.use)
- , async.apply(ENDER.npm.prettyPrintDependencies, activePackages)
- ])
+ if (type === 'install') {
+ var build = function build(_data, callback) {
+ _data = (_data instanceof Array) ? _data : [_data]
+ _data.forEach(function(pck, i) {
+ if (options.use) {
+ if (pck[1].output && pck[1].output === options.use) {
+ console.log('pck.output && pck.output === options.use', pck)
+ activePackages = pck[0];
+ activeOptions = pck[1];
+ }
+ }
+ else {
+ activePackages = _data[0][0];
+ activeOptions = _data[0][1];
+ }
+ })
+ callback && callback();
+ }
+
+ async.waterfall([
+ async.apply(fs.readFile, 'package.json', 'utf-8')
+ , async.apply(ENDER.npm.extractFromPackage)
+ , async.apply(build)
+ , printInfo
+ ])
+ }
+ else {
+ printInfo()
+ }
}
}
View
2  test/package_with_args.json
@@ -1,5 +1,5 @@
{
- "name":"Multiple ender build"
+ "name":"single_ender_build_with_options"
, "ender":{
"dependencies":{
"bean":"latest"
View
2  test/package_with_array.json
@@ -1,5 +1,5 @@
{
- "name":"Single ender build"
+ "name":"multiple_ender_builds"
, "ender":[
{
"dependencies":{

No commit comments for this range

Something went wrong with that request. Please try again.