Skip to content

Added support for script chaining and env vars #153

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

Merged
merged 3 commits into from
May 12, 2023

Conversation

mitsuhiko
Copy link
Collaborator

@mitsuhiko mitsuhiko commented May 12, 2023

This adds support for script chaining and environment variables like so:

[tool.rye.scripts]
serve = { cmd = "flask run", env = {"FLASK_APP" = "./hello.py"} }
lint = { chain = ["lint:black", "lint:flake8" ] }
"lint:black" = "black --check src"
"lint:flake8" = "flake8 src"

With this you can run rye run lint to invoke first rye run lint:black followed by rye run lint:flake8 if the first script did not fail. This really needs docs.

Output in list:

lint (chain: [lint:black], [lint:flake8])
lint:black (black --check src)
lint:flake8 (flake8 src)
serve (FLASK_APP=./hello.py flask run)

Fixes #152

@mitsuhiko mitsuhiko changed the title Added support for script chaining Added support for script chaining and env vars May 12, 2023
@mitsuhiko mitsuhiko mentioned this pull request May 12, 2023
@mitsuhiko mitsuhiko merged commit 6f45e79 into main May 12, 2023
@mitsuhiko mitsuhiko deleted the feature/script-chaining branch May 12, 2023 21:43
ischaojie pushed a commit to ischaojie/rye that referenced this pull request May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running multiple commands in scripts with rye
1 participant