-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Create missing dir for uv export/ uv pip compile
#9648
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,6 +231,12 @@ impl<'a> OutputWriter<'a> { | |
| /// Commit the buffer to the output file. | ||
| async fn commit(self) -> std::io::Result<()> { | ||
| if let Some(output_file) = self.output_file { | ||
| if let Some(parent_dir) = output_file.parent() { | ||
| if !parent_dir.as_os_str().is_empty() && !parent_dir.is_dir() { | ||
| fs_err::tokio::create_dir(parent_dir).await?; | ||
|
||
| } | ||
| } | ||
|
|
||
| // If the output file is an existing symlink, write to the destination instead. | ||
| let output_file = fs_err::read_link(output_file) | ||
| .map(Cow::Owned) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
try_exists? What happens if the parent is a link to another directory? What happens if it's a file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I've changed it to
try_exists