You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if grabit did not actually download anything if the correct file is already present in the target directory.
Proposed Solution
Check the target download directory and see if the file is present. If it is, validate its checksum. If it validates, don't do the download.
If either the file is missing or its checksum fails to validate, do the download as normal.
Alternatives Considered
The only downside that I can think of is that there is a scenario where this "check and see if I need to download" scheme would actually take longer:
grabit sees that a target file foo is present in the target directory
grabit reads the file and computes the checksum
the checksum does not validate
grabit downloads a fresh copy of the file
grabit reads the file and computes the checksum
In this scenario, grabit has to read the file twice and compute its checksum twice. If the file is large, this could be costly. But this may be a rare enough case not to worry about.
Additional Context
This is a minor optimization, but it would be helpful in repetitive developer scenarios (e.g., multiple builds in a row) where grabit may be in the main build code path.
The text was updated successfully, but these errors were encountered:
Problem Statement
It would be great if
grabit
did not actually download anything if the correct file is already present in the target directory.Proposed Solution
Check the target download directory and see if the file is present. If it is, validate its checksum. If it validates, don't do the download.
If either the file is missing or its checksum fails to validate, do the download as normal.
Alternatives Considered
The only downside that I can think of is that there is a scenario where this "check and see if I need to download" scheme would actually take longer:
grabit
sees that a target filefoo
is present in the target directorygrabit
reads the file and computes the checksumgrabit
downloads a fresh copy of the filegrabit
reads the file and computes the checksumIn this scenario,
grabit
has to read the file twice and compute its checksum twice. If the file is large, this could be costly. But this may be a rare enough case not to worry about.Additional Context
This is a minor optimization, but it would be helpful in repetitive developer scenarios (e.g., multiple builds in a row) where
grabit
may be in the main build code path.The text was updated successfully, but these errors were encountered: