Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Allow specifying script commands relative to the project root#1328

Open
brandon-avantus wants to merge 1 commit intoastral-sh:mainfrom
brandon-avantus:relative-script-paths
Open

Allow specifying script commands relative to the project root#1328
brandon-avantus wants to merge 1 commit intoastral-sh:mainfrom
brandon-avantus:relative-script-paths

Conversation

@brandon-avantus
Copy link
Copy Markdown

Command paths with a leading ./ have the project root prepended, which allows scripts in the project tree to be used with rye run even when the current directory is not the project root.

Command paths with a leading `./` have the project root prepended, which
allows scripts in the project tree to be used with `rye run` even when
the current directory is not the project root.
Comment thread rye/src/cli/run.rs

let path = std::path::Path::new(&args[0]);
if path.starts_with("./") {
args[0] = pyproject.root_path().join(path).into();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just always join this, since if path is absolute, joining just resolves to path.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants