#!/bin/sh # TidyMac installer: https://tidymac.space/install/ # Downloads TidyMac.dmg, verifies it mounts and contains TidyMac.app, copies it to /Applications and opens it. # Files fetched with curl don't get the quarantine flag, so there's no "can't be opened" prompt. set -eu URL="https://tidymac.space/download/TidyMac.dmg" [ "$(uname)" = "Darwin" ] || { echo "TidyMac is a Mac app."; exit 1; } major=$(sw_vers -productVersion | cut -d. -f1) [ "$major" -ge 15 ] || { echo "TidyMac needs macOS 15 Sequoia or later (you have $(sw_vers -productVersion))."; exit 1; } tmp=$(mktemp -d) trap 'hdiutil detach "$tmp/mnt" -quiet >/dev/null 2>&1 || true; rm -rf "$tmp"' EXIT echo "Downloading TidyMac…" curl -fL --progress-bar "$URL" -o "$tmp/TidyMac.dmg" hdiutil attach "$tmp/TidyMac.dmg" -nobrowse -readonly -mountpoint "$tmp/mnt" -quiet [ -d "$tmp/mnt/TidyMac.app" ] || { echo "The download looks wrong. Please try again or use https://tidymac.space/download/"; exit 1; } if [ -d /Applications/TidyMac.app ]; then osascript -e 'tell application "TidyMac" to quit' >/dev/null 2>&1 || true rm -rf /Applications/TidyMac.app fi echo "Copying to Applications…" ditto "$tmp/mnt/TidyMac.app" /Applications/TidyMac.app echo "Done. Opening TidyMac." open /Applications/TidyMac.app