update for latest API
[webi-installers/.git] / macos / macos.bash
index 4b6a35c277854e2f3705a7e6bb5c1fb851fbd0eb..fc49db9c2f68c3a30ebd9bf1aece77f97d5493f6 100644 (file)
@@ -8,33 +8,16 @@
 #   Use with Balena Etcher to burn ISO to USB, or boot with VirtualBox.
 #
 #   ```txt
-#   el-capitan.iso
+#   Created ~/Downloads/el-capitan.iso
 #   ```
 
 set -e
 set -u
 
-if [ -z "${WEBI_PKG_URL:-}" ]; then
-  # dmg
-  release_tab="${WEBI_HOST}/api/releases/macos@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&limit=1"
-  echo $release_tab
-  WEBI_CSV=$(curl -fsSL "$release_tab" -H "User-Agent: $(uname -a)")
-  echo $WEBI_CSV
-  WEBI_CHANNEL=$(echo $WEBI_CSV | cut -d ',' -f 3)
-  echo $WEBI_CHANNEL
-  if [ "error" == "$WEBI_CHANNEL" ]; then
-     echo "could not find release for macOS v${WEBI_VERSION}"
-     exit 1
-  fi
-  WEBI_VERSION=$(echo $WEBI_CSV | cut -d ',' -f 1)
-  WEBI_PKG_URL=$(echo $WEBI_CSV | cut -d ',' -f 9)
-fi
+webi_download
 
-mkdir -p ~/Downloads
 pushd ~/Downloads 2>&1 >/dev/null
 
-wget -c "$WEBI_PKG_URL"
-
 if [ "Darwin" == "$(uname -s)" ]; then
   curl -fsSL 'https://gist.githubusercontent.com/solderjs/8c36d132250163011c83bad8284975ee/raw/5a291955813743c20c12ca2d35c7b1bb34f8aecc/create-bootable-installer-for-os-x-el-capitan.sh' -o create-bootable-installer-for-os-x-el-capitan.sh
   bash create-bootable-installer-for-os-x-el-capitan.sh
@@ -48,4 +31,8 @@ else
   bash linux-create-bootable-macos-recovery-image.sh
 fi
 
+echo ""
+echo "Created $HOME/Downloads/el-capitan.iso"
+echo ""
+
 popd 2>&1 >/dev/null