Skip to content
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

fix(iroh): check output for blob get #1898

Merged
merged 2 commits into from
Dec 18, 2023
Merged

Conversation

dignifiedquire
Copy link
Contributor

Check we the result can be written to, before downloading.

Check we the result can be written to, before downloading.
@@ -217,6 +217,10 @@ impl BlobCommands {
Some(OutputTarget::Stdout) => DownloadLocation::Internal,
Some(OutputTarget::Path(ref path)) => {
let absolute = std::env::current_dir()?.join(path);
ensure!(
absolute.is_file() || !absolute.exists(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's a single blob and the absolute does not exist we probably also want to check that the parent does exist

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or should we just create the full path if not? 🤔

Copy link
Contributor

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need more validation but this is a good step forward

@dignifiedquire dignifiedquire added this pull request to the merge queue Dec 18, 2023
Merged via the queue into main with commit 52f17a3 Dec 18, 2023
26 checks passed
fubuloubu pushed a commit to ApeWorX/iroh that referenced this pull request Feb 21, 2024
Check we the result can be written to, before downloading.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants