Skip to content

Commit f1b8f6d

Browse files
committed
returns 1 if the tarball is invalid
1 parent 35b05eb commit f1b8f6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: tasks/download.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ download() {
3939
tmp_file=$(mktemp "peadm-download")
4040
echo "Temporary file created at: ${tmp_file}"
4141
curl -s -f -L -o ${tmp_file} "$1"
42-
if [ tar -tzf "${tmp_file}" >/dev/null ]; then
42+
if [[ tar -tzf "${tmp_file}" >/dev/null ]]; then
4343
mv "${tmp_file}" "$2"
44+
return 0
4445
else
4546
echo "Puppet Enterprise download failed: Invalid tarball"
4647
echo "|_ Removing temporary file: ${tmp_file}"
4748
rm "${tmp_file}"
49+
return 1
4850
fi
4951
}
5052

0 commit comments

Comments
 (0)