Skip to content

Commit

Permalink
Merge pull request pahen#144 from realityking/dev-deps
Browse files Browse the repository at this point in the history
Update dev-dependencies
  • Loading branch information
pahen authored Dec 9, 2017
2 parents b8be1fa + 576f9bc commit dd88e14
Show file tree
Hide file tree
Showing 4 changed files with 1,109 additions and 1,671 deletions.
140 changes: 70 additions & 70 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,91 +135,91 @@ new Promise((resolve, reject) => {
resolve(program.args);
}
})
.then((src) => {
if (!program.json && !program.dot) {
spinner.start();
config.dependencyFilter = dependencyFilter();
}
.then((src) => {
if (!program.json && !program.dot) {
spinner.start();
config.dependencyFilter = dependencyFilter();
}

return madge(src, config);
})
.then((res) => {
if (!program.json && !program.dot) {
spinner.stop();
output.getResultSummary(res, startTime);
}
return madge(src, config);
})
.then((res) => {
if (!program.json && !program.dot) {
spinner.stop();
output.getResultSummary(res, startTime);
}

if (program.summary) {
output.summary(res.obj(), {
json: program.json
});
if (program.summary) {
output.summary(res.obj(), {
json: program.json
});

return res;
}
return res;
}

if (program.depends) {
output.modules(res.depends(program.depends), {
json: program.json
});
if (program.depends) {
output.modules(res.depends(program.depends), {
json: program.json
});

return res;
}
return res;
}

if (program.orphans) {
output.modules(res.orphans(), {
json: program.json
});
if (program.orphans) {
output.modules(res.orphans(), {
json: program.json
});

return res;
}
return res;
}

if (program.circular) {
const circular = res.circular();
if (program.circular) {
const circular = res.circular();

output.circular(spinner, res, circular, {
json: program.json
});
output.circular(spinner, res, circular, {
json: program.json
});

if (circular.length) {
exitCode = 1;
}

if (circular.length) {
exitCode = 1;
return res;
}

return res;
}
if (program.image) {
return res.image(program.image).then((imagePath) => {
spinner.succeed(`${chalk.bold('Image created at')} ${chalk.cyan.bold(imagePath)}`);
return res;
});
}

if (program.image) {
return res.image(program.image).then((imagePath) => {
spinner.succeed(`${chalk.bold('Image created at')} ${chalk.cyan.bold(imagePath)}`);
return res;
});
}
if (program.dot) {
return res.dot().then((output) => {
process.stdout.write(output);
return res;
});
}

if (program.dot) {
return res.dot().then((output) => {
process.stdout.write(output);
return res;
output.list(res.obj(), {
json: program.json
});
}

output.list(res.obj(), {
json: program.json
});

return res;
})
.then((res) => {
if (program.warning && !program.json) {
output.warnings(res);
}
return res;
})
.then((res) => {
if (program.warning && !program.json) {
output.warnings(res);
}

if (!program.json && !program.dot) {
console.log('');
}
if (!program.json && !program.dot) {
console.log('');
}

process.exit(exitCode);
})
.catch((err) => {
spinner.stop();
console.log('\n%s %s\n', chalk.red('✖'), err.stack);
process.exit(1);
});
process.exit(exitCode);
})
.catch((err) => {
spinner.stop();
console.log('\n%s %s\n', chalk.red('✖'), err.stack);
process.exit(1);
});
12 changes: 6 additions & 6 deletions lib/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ class Tree {
}
}

/**
* Expose API.
* @param {Array} srcPaths
* @param {Object} config
* @return {Promise}
*/
/**
* Expose API.
* @param {Array} srcPaths
* @param {Object} config
* @return {Promise}
*/
module.exports = (srcPaths, config) => new Tree(srcPaths, config);
Loading

0 comments on commit dd88e14

Please sign in to comment.