Multiple shell commands in pipenv script
See original GitHub issueScripts 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
- that’s a bit inconvenient
- 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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, I know - I didn’t mean sound annoyed or brash in my response, it was just a note for future travellers.
@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!