From cbdd4df33c94b134c62b7615c00ce77aca9b440e Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Sun, 27 Sep 2026 15:37:13 -0500 Subject: [PATCH] fix(update-nvim-config): repair the command and match file to label The one-line bash -c string had been re-wrapped mid-command, so bash ran a bare pkill, then a headless nvim that never exited, and never reached git pull. launchd won't start a job that is still running, so the config had stopped updating altogether. Put one command per line, escape &&, and move PATH into EnvironmentVariables. Rename the plist to match its label, which is also the name setup_automations.sh bootstraps; before this, a fresh install downloaded update-nvim-config.plist and then failed to load it. --- ...onfig.plist => com.user.update-nvim-config.plist} | 12 +++++++++--- setup_automations.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) rename LaunchAgents/{update-nvim-config.plist => com.user.update-nvim-config.plist} (67%) diff --git a/LaunchAgents/update-nvim-config.plist b/LaunchAgents/com.user.update-nvim-config.plist similarity index 67% rename from LaunchAgents/update-nvim-config.plist rename to LaunchAgents/com.user.update-nvim-config.plist index e517d7e..18910ea 100644 --- a/LaunchAgents/update-nvim-config.plist +++ b/LaunchAgents/com.user.update-nvim-config.plist @@ -8,12 +8,18 @@ /bin/bash -c + - export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH" - pkill nvim || true - cd "$HOME/.config/nvim" && git checkout main && git pull origin main + pkill nvim + cd "$HOME/.config/nvim" || exit 1 + git checkout main && git pull origin main + EnvironmentVariables + + PATH + /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin + StartCalendarInterval Hour diff --git a/setup_automations.sh b/setup_automations.sh index 393b7ff..a92a0f8 100644 --- a/setup_automations.sh +++ b/setup_automations.sh @@ -5,7 +5,7 @@ fi cd "$HOME/Library/LaunchAgents" || exit 1 curl -LO https://github.com/JMR-dev/mac_util_scripts/raw/refs/heads/main/LaunchAgents/com.user.homebrew-update.plist curl -LO https://github.com/JMR-dev/mac_util_scripts/raw/refs/heads/main/LaunchAgents/com.user.restart-browsers.plist -curl -LO https://github.com/JMR-dev/mac_util_scripts/raw/refs/heads/main/LaunchAgents/update-nvim-config.plist +curl -LO https://github.com/JMR-dev/mac_util_scripts/raw/refs/heads/main/LaunchAgents/com.user.update-nvim-config.plist # Install Commands launchctl bootstrap gui/"$(id -u)" com.user.homebrew-update.plist launchctl bootstrap gui/"$(id -u)" com.user.restart-browsers.plist