Skip to content

Commit c7130d7

Browse files
committed
fix bad bash syntax
download.sh was run with /bin/sh, where `==` is not a portable test operator. On Ubuntu, it reports `unexpected operator` when parsing entries that use `->` rename syntax, causing GitHub tarballs to be saved as `master` instead of the expected archive filename. Fixed with POSIX `=` and guard the optional argument with `${2:-}` so renamed archive downloads work.
1 parent 9dc07ee commit c7130d7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

download.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ if [ $previous_file = no -o "$remote_size" != "$local_size" ]; then
4242
while [ "$#" -gt 0 ]; do
4343
url="$1"
4444
rename=""
45-
if [ "$2" == "->" ]; then
46-
rename="$3"
47-
shift
48-
shift
45+
if [ "${2:-}" = "->" ]; then
46+
rename="$3"
47+
shift
48+
shift
4949
fi
5050
if [ "$#" -gt 1 ]; then
5151
wget ${rename:+-O} ${rename} --tries 5 --timeout 15 --continue "$url" && break

0 commit comments

Comments
 (0)