Implement write_to_disk for uri backends#164
Implement write_to_disk for uri backends#164njgheorghita wants to merge 2 commits intoethpm:masterfrom
Conversation
78cbeb8 to
6c6c44f
Compare
6c6c44f to
5f39521
Compare
pipermerriam
left a comment
There was a problem hiding this comment.
This doesn't look like the right API seeing as the same logic is repeated in both IPFS and Github backends. Maybe this should be a singular utility function that takes a backend, a URI and the target path and does the writing to disk?
Can you show me more of how this would be used in the core library API?
|
Yeah, that's a fair point. I'm not against moving this logic to a util function. I was just thinking it might be cleaner/simpler since you already have the IPFS backend to do something like ipfs_backend.write_to_disk(uri, target_path)rather than import write_uri_to_disk
write_uri_to_disk(ipfs_backend, uri, target_path)In terms of duplicating the logic, I just moved the definition of |
|
I guess this relates to how we interact with the ipfs backend in general. Typically, I find myself instantiating a specific backend (i.e. |
What was wrong?
Writing resolved ipfs uris to disk is something I find myself doing a lot manually, and would be useful if available on uri backends.
Cute Animal Picture