diff --git a/crates/uv/src/commands/tool/update_shell.rs b/crates/uv/src/commands/tool/update_shell.rs index 36cf7c91cdcd..f306d80fea23 100644 --- a/crates/uv/src/commands/tool/update_shell.rs +++ b/crates/uv/src/commands/tool/update_shell.rs @@ -73,7 +73,12 @@ pub(crate) async fn update_shell(printer: Printer) -> Result { // Search for the command in the file, to avoid redundant updates. match fs_err::tokio::read_to_string(&file).await { Ok(contents) => { - if contents.contains(&command) { + if contents + .lines() + .map(str::trim) + .filter(|line| !line.starts_with('#')) + .any(|line| line.contains(&command)) + { debug!( "Skipping already-updated configuration file: {}", file.simplified_display()