Skip to content

Commit 7c2e592

Browse files
committed
Merge branch 'master' of github.com:OpenSourceBrain/OSBv2 into develop
2 parents f925b24 + af737ab commit 7c2e592

File tree

1 file changed

+11
-1
lines changed
  • applications/workspaces/tasks/biomodels-copy

1 file changed

+11
-1
lines changed

applications/workspaces/tasks/biomodels-copy/run.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ else
3030
echo "${path}" >> filelist
3131
done
3232
echo Biomodels downloading files
33-
aria2c --retry-wait=2 --max-tries=5 --input-file=filelist --max-concurrent-downloads=5 --max-connection-per-server=5 --allow-overwrite "true" --auto-file-renaming "false"
33+
# Move to temporary directory to rename only the downloaded files.
34+
# Otherwise we risk renaming all files, even ones where the user has used
35+
# '+' in the file name explicitly
36+
tempdir=$(mktemp -d)
37+
pushd "${tempdir}"
38+
aria2c --retry-wait=2 --max-tries=5 --input-file=filelist --max-concurrent-downloads=5 --max-connection-per-server=5 --allow-overwrite "true" --auto-file-renaming "false"
39+
rename -a '+' ' ' *.*
40+
popd
41+
mv "${tempdir}/*" .
42+
# directory should be empty, so rmdir will work
43+
rmdir "${tempdir}"
3444
rm filelist -f
3545
fi
3646

0 commit comments

Comments
 (0)