question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple shell commands in pipenv script

See original GitHub issue

Scripts should allow multiple shell commands to be run as one “script”. Both Yarn and npm allow this. Currently, if you try to do this:

[scripts]
foo = "echo 'bar' && echo 'baz'"

it will result in bar && echo baz. You can sidestep this issue by doing something like

[scripts]
foo = "bash -c \"echo 'bar' && echo 'baz'\""

but

  1. that’s a bit inconvenient
  2. it isn’t a cross-platform solution (it won’t work on Windows)

The use case that I have is running coverage report after running coverage, but it’s definitely something that would have many general uses.


Expected result

Running pipenv run foo should result in:

bar
baz
Actual result

Running pipenv run foo results in:

bar && echo baz
Steps to replicate

Create a Pipfile with the following:

[scripts]
foo = "bash -c \"echo 'bar' && echo 'baz'\""

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
stevenhaircommented, May 9, 2018

Oh, I know - I didn’t mean sound annoyed or brash in my response, it was just a note for future travellers.

1reaction
techalchemycommented, May 9, 2018

@stevenhair as a FYI the duplicate tag isn’t really a criticism or a dismissal it’s more for internal note and as a note to other maintainers that we have already hashed this out. Nothing personal, the request is legitimate – it just carries a lot of complexity that we can’t afford to support. Thanks for filing the issue and digging up the reference!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I run two commands with pipenv scripts using
When I run it from the shell $ pylint src && pylint tests , I have no problems. But when I run it...
Read more >
[Solved]-Make `pipenv run` run multiple commands-docker
A shell script that will run our commands. This is designed to be run within the pipenv environment. This is scripts/pipenv-run-tests.sh :
Read more >
Advanced Usage of Pipenv - Read the Docs
Pipenv allows you to open any Python module that is installed (including ones in your codebase), with the $ pipenv open command: $...
Read more >
Pipenv & Virtual Environments
Using $ pipenv run ensures that your installed packages are available to your script. It's also possible to spawn a new shell that...
Read more >
I love pipenv's custom script shortcuts - DEV Community ‍ ‍
Pipenv supports to customize shortcuts in the scripts section. pipenv run ... because if you really need to make a multiple command script, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found