Skip to content

Commit

Permalink
Add newline after shebang
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Aug 21, 2024
1 parent 834510e commit 13bf3cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/uv-scripts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ impl Pep723Script {
let metadata = Pep723Metadata::from_str(&default_metadata)?;

// Extract the shebang and script content.
let (prelude, postlude) = extract_shebang(&contents)?;
let (shebang, postlude) = extract_shebang(&contents)?;

Ok(Self {
path: file.as_ref().to_path_buf(),
prelude,
prelude: if shebang.is_empty() {
String::new()
} else {
format!("{shebang}\n")
},
metadata,
postlude,
})
Expand Down

0 comments on commit 13bf3cb

Please sign in to comment.