Skip to content

Commit f090bbc

Browse files
committed
fixup: flatten download-release-artifacts
1 parent 0293899 commit f090bbc

File tree

1 file changed

+33
-37
lines changed

1 file changed

+33
-37
lines changed

desktop/scripts/release/download-release-artifacts

+33-37
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,37 @@ URL_BASE="https://releases.mullvad.net/desktop/releases"
2121

2222
mkdir -p $ARTIFACT_DIR
2323

24-
function download_and_verify {
25-
# Find GnuPG command to use. Prefer gpg2
26-
gpg_cmd=$(command -v gpg2 || command -v gpg)
27-
28-
for ext in .exe _arm64.exe _x64.exe _amd64.deb _arm64.deb _x86_64.rpm _aarch64.rpm .pkg; do
29-
pkg_filename="MullvadVPN-${PRODUCT_VERSION}${ext}"
30-
pkg_path="$ARTIFACT_DIR/$pkg_filename"
31-
url="$URL_BASE/$PRODUCT_VERSION/$pkg_filename"
32-
33-
if [ -f "$pkg_path" ]; then
34-
echo ">>> Using existing file: $pkg_filename"
35-
else
36-
echo ">>> Downloading $pkg_filename - $url"
37-
curl -o "$pkg_path" --progress-bar --fail "$url"
38-
fi
39-
40-
if [ -f "$pkg_path.asc" ]; then
41-
echo ">>> Using existing file: $pkg_filename.asc"
42-
else
43-
echo ">>> Downloading $pkg_filename.asc - $url.asc"
44-
curl -o "$pkg_path.asc" --progress-bar --fail "$url.asc"
45-
fi
46-
47-
echo ""
48-
echo ">>> Verifying integrity of $pkg_filename"
49-
if ! $gpg_cmd --verify "$pkg_path.asc" "$pkg_path"; then
50-
echo ""
51-
echo "!!! INTEGRITY CHECKING FAILED !!!"
52-
rm "$pkg_path" "$pkg_path.asc"
53-
exit 1
54-
fi
24+
# Find GnuPG command to use. Prefer gpg2
25+
gpg_cmd=$(command -v gpg2 || command -v gpg)
26+
27+
for ext in .exe _arm64.exe _x64.exe _amd64.deb _arm64.deb _x86_64.rpm _aarch64.rpm .pkg; do
28+
pkg_filename="MullvadVPN-${PRODUCT_VERSION}${ext}"
29+
pkg_path="$ARTIFACT_DIR/$pkg_filename"
30+
url="$URL_BASE/$PRODUCT_VERSION/$pkg_filename"
31+
32+
if [ -f "$pkg_path" ]; then
33+
echo ">>> Using existing file: $pkg_filename"
34+
else
35+
echo ">>> Downloading $pkg_filename - $url"
36+
curl -o "$pkg_path" --progress-bar --fail "$url"
37+
fi
38+
39+
if [ -f "$pkg_path.asc" ]; then
40+
echo ">>> Using existing file: $pkg_filename.asc"
41+
else
42+
echo ">>> Downloading $pkg_filename.asc - $url.asc"
43+
curl -o "$pkg_path.asc" --progress-bar --fail "$url.asc"
44+
fi
45+
46+
echo ""
47+
echo ">>> Verifying integrity of $pkg_filename"
48+
if ! $gpg_cmd --verify "$pkg_path.asc" "$pkg_path"; then
5549
echo ""
56-
echo "GOOD SIGNATURE FOR $pkg_filename"
57-
echo ""
58-
done
59-
}
60-
61-
download_and_verify
50+
echo "!!! INTEGRITY CHECKING FAILED !!!"
51+
rm "$pkg_path" "$pkg_path.asc"
52+
exit 1
53+
fi
54+
echo ""
55+
echo "GOOD SIGNATURE FOR $pkg_filename"
56+
echo ""
57+
done

0 commit comments

Comments
 (0)