Universal macOS background auto-updater script for the Cursor AI editor. Automates updates daily at 10:00 AM using Homebrew and launchd without losing custom multi-profile settings, account data, or… A developer published a Bash script that automates daily updates of the Cursor AI editor on macOS using Homebrew and a launchd agent. The updater runs at 10:00 AM via a generated plist, logs to ~/Library/Logs/cursor_update.log, and includes install, disable, and uninstall functions that preserve custom multi-profile settings, account data, and launch shortcuts. | | /bin/bash | | | USER HOME="$HOME" | | | USER NAME=$ whoami | | | SCRIPT DIR="$USER HOME/Scripts" | | | SCRIPT PATH="$SCRIPT DIR/auto update cursor.sh" | | | PLIST PATH="$USER HOME/Library/LaunchAgents/com.user.autoupdatecursor.plist" | | | LOG PATH="$USER HOME/Library/Logs/cursor update.log" | | | install updater { | | | echo "" | | | echo "=== Setting up Universal Cursor Auto-Updater ===" | | | 1. Ensure Homebrew is installed | | | if command -v brew & /dev/null && -f /opt/homebrew/bin/brew && -f /usr/local/bin/brew ; then | | | echo "❌ Error: Homebrew is not installed on this Mac. Please install Homebrew first." | | | return 1 | | | fi | | | 2. Check if manual copy of Cursor exists and link to Homebrew | | | echo "Checking Cursor installation status..." | | | if -d "/Applications/Cursor.app" ; then | | | echo "Cursor found in Applications. Linking Homebrew to manage it..." | | | /opt/homebrew/bin/brew install --cask --force cursor \|\| /usr/local/bin/brew install --cask --force cursor | | | else | | | echo "Installing Cursor via Homebrew..." | | | /opt/homebrew/bin/brew install --cask cursor \|\| /usr/local/bin/brew install --cask cursor | | | fi | | | 3. Create directories and local automation runner script | | | mkdir -p "$SCRIPT DIR" | | | echo "Generating update script at $SCRIPT PATH..." | | | cat << 'INNER EOF' "$SCRIPT PATH" | | | /bin/bash | | | export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" | | | echo "--- Cursor Update Check: $ date ---" | | | brew update 2 &1 | | | brew upgrade --cask cursor 2 &1 | | | echo "------------------------------------------------" | | | INNER EOF | | | chmod +x "$SCRIPT PATH" | | | 4. Clean up old background agent iterations if they exist | | | if launchctl list \| grep -q "com.user.autoupdatecursor"; then | | | launchctl unload "$PLIST PATH" 2 /dev/null | | | fi | | | 5. Generate background launch agent configuration plist | | | echo "Generating configuration agent file..." | | | cat << INNER EOF "$PLIST PATH" | | |