Skip to content

Commit 74195b1

Browse files
jimisjujokini
authored andcommitted
DownloadURL last argument (targetFile) is now optional
Change-Id: I0864bcb052cddcc9753c056758b6e65fd561d928 Reviewed-by: Tony Sarajärvi <[email protected]> (cherry picked from commit 6cc2215) Reviewed-by: Heikki Halmet <[email protected]>
1 parent 1f1832b commit 74195b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

coin/provisioning/common/unix/DownloadURL.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,14 @@ DownloadURL () {
8989
url=$1
9090
url2=$2
9191
expectedHash=$3
92-
targetFile=$4
92+
# Optional argument $4: destination filename
93+
if [ x"$4" = x ]
94+
then
95+
# defaults to the last component of $url
96+
targetFile=$(echo $url | sed 's|^.*/||')
97+
else
98+
targetFile=$4
99+
fi
93100

94101
if VerifyHash "$targetFile" "$expectedHash"
95102
then

0 commit comments

Comments
 (0)