Closed hellovictorlee closed 6 years ago
This is a nice addition, but I think this tool should not perform caching. It's unexpected and has the side effect of using unbounded amounts of disk space. It's also dangerous to perform network requests, so there should be a clear user intent before invoking curl. I'd suggest doing that only if the command is like imgcat --url http://example.com/image.gif
.
Merged with some small changes. Thanks1
curl I utilize curl to check if the file can be downloaded from the provided url. If yes, downloads it in the path "~/.iterm2/image_collection" and create a list.txt. list.txt file is used to check if the user has downloads file from the url. Users can save time if they have already downloaded the file from the url.
md5 I use the value of each file's md5 as its name. If I download a new file whose md5 value is identical to the file user downloaded, in practical, the new file is the same file. Therefore, we only need to store one.