Commit b3bfd868 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Skip downloads that already exist, even if there is no checksum to compare

parent 51ed5402
......@@ -308,7 +308,16 @@ def downloadPlugin(plugin : Plugin, destDir, **kwargs) -> Tuple[str, bool]:
info(f'{plugin.name}...', EMPHASIS)
if op.exists(destFile) and plugin.checksum is not None:
# if file exists, but we don't
# have a checksum to verify it,
# we assume that it is ok
if op.exists(destFile) and plugin.checksum is None:
skipDownload = True
# otherwise we compare checksums,
# and re-download the file if they
# don't match
elif op.exists(destFile) and plugin.checksum is not None:
info(f'{fname} already exists - calculating SHA256 checksum...')
destchecksum = calcChecksum(destFile)
if destchecksum == plugin.checksum:
......
......@@ -133,7 +133,9 @@ def parseArgs(argv : List[str]) -> argparse.Namespace:
}
parser = argparse.ArgumentParser(
'fsl_add_module', 'Download and install FSL plugins')
'fsl_add_module',
usage='fsl_add_module [options] [plugins]',
description='Download and install FSL plugins')
parser.add_argument(
'-V', '--version', action='version', help=helps['version'],
version='%(prog)s {}'.format(__VERSION__))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment