Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev-dependencies #144

Merged
merged 4 commits into from
Dec 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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