Skip to content

Commit

Permalink
Strip --index from command header
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Nov 20, 2024
1 parent b19ccb6 commit 3f354ab
Show file tree
Hide file tree
Showing 2 changed files with 373 additions and 23 deletions.
14 changes: 12 additions & 2 deletions crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,24 @@ fn cmd(

// Skip any index URLs, unless requested.
if !include_index_url {
if arg.starts_with("--extra-index-url=") || arg.starts_with("--index-url=") {
if arg.starts_with("--extra-index-url=")
|| arg.starts_with("--index-url=")
|| arg.starts_with("-i=")
|| arg.starts_with("--index=")
|| arg.starts_with("--default-index=")
{
// Reset state; skip this iteration.
*skip_next = None;
return Some(None);
}

// Mark the next item as (to be) skipped.
if arg == "--index-url" || arg == "--extra-index-url" {
if arg == "--index-url"
|| arg == "--extra-index-url"
|| arg == "-i"
|| arg == "--index"
|| arg == "--default-index"
{
*skip_next = Some(true);
return Some(None);
}
Expand Down
Loading

0 comments on commit 3f354ab

Please sign in to comment.