Skip to main content

Warn if there’s no download URL available

ID
6d9e662
date
2022-05-02 07:16:50+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
3f8f0c0
message
Warn if there's no download URL available
changed files
1 file, 6 additions

Changed files

update-vfd (610) → update-vfd (750)

diff --git a/update-vfd b/update-vfd
index 426542e..f40bf71 100755
--- a/update-vfd
+++ b/update-vfd
@@ -11,6 +11,12 @@ DOWNLOAD_URL=$(curl --silent 'https://api.github.com/repos/alexwlchan/books.alex
   | jq -r ' .assets | map(.browser_download_url) | map(select(test(".*darwin.*")))[0]'
 )
 
+if [[ "$DOWNLOAD_URL" == "null" ]]
+then
+  echo "No macOS download available for the latest version! Is it still building?" >&2
+  exit 1
+fi
+
 # The --location flag means we follow redirects
 curl --location "$DOWNLOAD_URL" > ~/.cargo/bin/vfd.tar.gz
 tar -xzf ~/.cargo/bin/vfd.tar.gz