#!/bin/bash # Installs Transcribe 1.9.1 on this Mac: # curl -fsSL https://transcribe.anthony-tong.com/install-mac.sh | bash # curl -fsSL https://transcribe.anthony-tong.com/install-mac.sh | bash -s -- --with-stems (also set up the stem separator) # Downloads the build for your chip, checks its SHA-256, puts Transcribe.app in /Applications # (or ~/Applications if that isn't writable), gives it the local ad-hoc signature macOS needs # to run an app that isn't signed by a registered developer, and opens it. # After this, Transcribe updates itself. # --with-stems asks Transcribe to download its optional stem separator (Python, PyTorch with Metal # GPU support, the Demucs model: about 0.4 GB) when it first opens; Stems menu does the same later. set -euo pipefail STEMS=0 for arg in "$@"; do case "$arg" in --with-stems) STEMS=1 ;; *) echo "Unknown option: $arg (did you mean --with-stems?)" >&2; exit 1 ;; esac done BASE="https://dl.anthony-tong.com/transcribe" case "$(uname -m)" in arm64) FILE="Transcribe-1.9.1-mac-arm64.tar.gz"; SHA="8c16ce10b8349319c3ed257926b890cf7fa062352cea93d60c4ccd0b8aca41d9"; CHIP="Apple Silicon" ;; x86_64) FILE="Transcribe-1.9.1-mac-intel.tar.gz"; SHA="387129f4728a8dcfe77d575d48a953c650e8ad0cfe36505c760e0748548874c8"; CHIP="Intel" ;; *) echo "Unsupported Mac: $(uname -m)" >&2; exit 1 ;; esac if pgrep -xq Transcribe; then echo "Transcribe is running. Quit it (Cmd+Q) and run this again." >&2; exit 1 fi DEST=/Applications [ -w "$DEST" ] || { DEST="$HOME/Applications"; mkdir -p "$DEST"; } TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT echo "Downloading Transcribe 1.9.1 for ${CHIP}..." curl -fL --progress-bar -o "$TMP/$FILE" "$BASE/$FILE" echo "$SHA $TMP/$FILE" | shasum -a 256 -c - >/dev/null || { echo "Download is corrupt (checksum mismatch). Try again." >&2; exit 1; } tar -xzf "$TMP/$FILE" -C "$TMP" xattr -cr "$TMP/Transcribe.app" codesign --force --deep --sign - "$TMP/Transcribe.app" 2>/dev/null rm -rf "$DEST/Transcribe.app" mv "$TMP/Transcribe.app" "$DEST/Transcribe.app" echo "Installed to ${DEST}/Transcribe.app" if [ "$STEMS" = 1 ]; then REQ="$HOME/Library/Application Support/Transcribe/stem-separator" mkdir -p "$REQ" && printf '{"gpu":true}' > "$REQ/install-requested" echo "The stem separator will download when Transcribe opens." fi open "$DEST/Transcribe.app"