#!/bin/zsh # RayNote installer: # # curl -fsSL https://raynote.leminhquang.com/install | zsh # # Downloads the newest RayNote, checks its SHA-256 against latest.json and its # code signature (Apple-issued certificate, RayNote's team and bundle id), then # runs the installer sealed inside the signed app. A file curl downloads is not # quarantined, so macOS shows no Gatekeeper warning. Running it again updates or # repairs an install; RayNote also updates itself after this. # # Everything is inside main(), called on the last line, so a download cut off # half way runs nothing. Child commands get /dev/null as stdin: with # `curl | zsh` stdin is this script, and a command reading it would eat the rest. main() { set -euo pipefail local BASE="https://raynote.leminhquang.com" local TEAM="97RLKG6B7X" local ID="com.ray.meeting-recorder" say() { print -P "%B$1%b"; } fail() { print -P "%F{red}$1%f" >&2; exit 1; } [[ "$(uname)" == "Darwin" ]] || fail "RayNote is a Mac app." local major="$(sw_vers -productVersion | cut -d. -f1)" (( major >= 15 )) || fail "RayNote needs macOS 15 or later; this Mac runs $(sw_vers -productVersion)." local tmp="$(mktemp -d /tmp/raynote-install.XXXXXX)" local mnt="$tmp/mnt" trap "hdiutil detach -quiet '$mnt' /dev/null 2>&1; rm -rf '$tmp'" EXIT say "Finding the newest RayNote..." local feed="$tmp/latest.json" curl -fsSL "$BASE/latest.json" -o "$feed" /dev/null || fail "The app is not signed by RayNote's developer; nothing was installed." [[ -f "$app/Contents/Resources/install.sh" ]] || fail "This RayNote build has no installer." # ffmpeg mixes the two audio tracks into the final file. Installed here when # Homebrew is present; otherwise the Setup window walks you through it. if ! [[ -x /opt/homebrew/bin/ffmpeg || -x /usr/local/bin/ffmpeg ]]; then local brew="" for b in /opt/homebrew/bin/brew /usr/local/bin/brew; do [[ -x "$b" ]] && brew="$b"; done if [[ -n "$brew" ]]; then say "Installing ffmpeg with Homebrew (a few minutes)..." "$brew" install ffmpeg