Skip to content

Conversation

@brandon-avantus
Copy link

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.

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.

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.

2 participants