diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 86e31454..340e95b3 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -727,12 +727,13 @@ def script(state, args): """Lists scripts in current environment config.""" from ..core import project if not project: - print("project not found") + echo(u"project not found", err=True) exit(1) - scripts = project.parsed_pipfile.get('scripts', []) - print("command\tscript") + scripts = project.parsed_pipfile.get('scripts', {}) + rpt = u"command\tscript\n" for k, v in scripts.items(): - print(f"{k}\t{v}") + rpt += u"{0}\t{1}".format(k, v) + echo(rpt) return diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index e48c15de..d37b4bf1 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -202,7 +202,7 @@ def test_scripts(PipenvInstance): with PipenvInstance() as p: with open(p.pipfile_path, "w") as f: contents = """ -[script] +[scripts] pyver = "which python" """.strip() f.write(contents)