Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #154 from apiaryio/honzajavorek/exit-code
Browse files Browse the repository at this point in the history
Exit code & print more details
  • Loading branch information
abtris committed Feb 28, 2018
2 parents 073d7cb + 19e16ef commit 3b78790
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions blackbelt/commands/dep.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import subprocess
import sys

import click
import requests
Expand Down Expand Up @@ -46,4 +46,5 @@ def validate_dep(ctx, param, dep):
default=lambda: os.path.join(os.getcwd(), 'licenses.txt'),
help='Where to save the Public License field contents.')
def check(*args, **kwargs):
do_check(*args, **kwargs)
if not do_check(*args, **kwargs):
sys.exit(1)
9 changes: 8 additions & 1 deletion blackbelt/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,18 @@ def check(dep, list_path, licenses_path, dev=False, debug=False):
click.secho('\n{name}@{version}'.format(**details), bold=True, fg=color)
click.echo((
'License: {licenses}\n'
'Copyright Notice: {copyright_notice}\n'
'Dependencies: {dependencies}\n'
'Elligible for Pre-Approval: {pre_approval_verdict}'
'Elligible for Pre-Approval: {pre_approval_verdict}\n\n'
'Package: https://npmjs.com/package/{name}\n'
'Repo: {repo}\n'
).format(
licenses=details['licenses'],
copyright_notice=details['copyright_notice'],
dependencies=len(fourth_party_licenses),
pre_approval_verdict=pre_approval_verdict,
name=details['name'],
repo=details.get('repo', 'N/A'),
))

problematic_licenses = [
Expand Down Expand Up @@ -130,6 +136,7 @@ def check(dep, list_path, licenses_path, dev=False, debug=False):
)
if not debug:
click.echo('\nProTip: You can use --debug to print more details.')
return pre_approval_verdict


def install(dep_name, dep_version, project_dir, dev=False):
Expand Down

0 comments on commit 3b78790

Please sign in to comment.