Skip to content
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

Allow specifying script commands relative to the project root #1328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rye/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ fn invoke_script(
.map(OsString::from)
.chain(args.into_iter().skip(1))
.collect();

let path = std::path::Path::new(&args[0]);
if path.starts_with("./") {
args[0] = pyproject.root_path().join(path).into();
Copy link
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.

}
}
}
Some(Script::External(_)) => {
Expand Down