Skip to content

Commit 9fad15d

Browse files
committed
prettify & add manual download link
1 parent 8a9f8cc commit 9fad15d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

download_latest.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ set -o errexit
44

55
MONGOSH_RELEASES_URL=https://downloads.mongodb.com/compass/mongosh.json
66

7+
show_download_link() {
8+
echo >&2 "Download mongosh manually from:"
9+
echo >&2
10+
printf >&2 "\t%s\n", 'https://www.mongodb.com/try/download/shell'
11+
}
12+
713
for tool in jq curl; do
814
which "$tool" >/dev/null || {
915
echo >&2 "This script requires '$tool'."
@@ -23,7 +29,9 @@ case "$os" in
2329
ext=zip
2430
;;
2531
*)
26-
echo >&2 "This script does not support this OS ($os). Download mongosh manually."
32+
echo >&2 "❌ This script does not support this OS ($os)."
33+
show_download_link
34+
2735
exit 1
2836
esac
2937

@@ -53,7 +61,8 @@ EOF
5361
url=$(curl -fsSL $MONGOSH_RELEASES_URL | jq -r "$jq_query")
5462

5563
if [ -z "$url" ]; then
56-
echo >&2 "No download found for $os on $arch; download manually."
64+
echo >&2 "❓ No download found for $os on $arch."
65+
show_download_link
5766
exit 1
5867
fi
5968

@@ -80,7 +89,8 @@ case "$ext" in
8089
;;
8190
*)
8291
echo >&2 "Bad file extension: $ext"
92+
show_download_link
8393
exit 1
8494
esac
8595

86-
echo "Success! 'mongosh' and its crypto library are now saved in this directory."
96+
echo "Success! 'mongosh' and its crypto library are now saved in this directory."

0 commit comments

Comments
 (0)