diff --git a/.stow-local-ignore b/.stow-local-ignore index 47d2899..cee39e4 100644 --- a/.stow-local-ignore +++ b/.stow-local-ignore @@ -2,6 +2,7 @@ ^/Brewfile* ^/README.* ^/LICENSE.* +^/LaunchAgents* \.git \.gitignore diff --git a/macOS/LaunchAgents/com.michael.clear-screenshots.plist b/macOS/LaunchAgents/com.michael.clear-screenshots.plist index ecfd82f..ed33765 100644 --- a/macOS/LaunchAgents/com.michael.clear-screenshots.plist +++ b/macOS/LaunchAgents/com.michael.clear-screenshots.plist @@ -25,5 +25,9 @@ michael RunAtLoad + StandardOutPath + /var/log/com.michael.clear-screenshots.out.log + StandardErrorPath + /var/log/com.michael.clear-screenshots.error.log diff --git a/scripts/install_launch_agents b/scripts/install_launch_agents index 25d5b0b..f5bb61b 100755 --- a/scripts/install_launch_agents +++ b/scripts/install_launch_agents @@ -2,19 +2,19 @@ set -e -# Installs launchd agents for appropriately. +# Installs launchd agents. -agent="$HOME/Library/LaunchAgents" +agent_dir="${HOME}/Library/LaunchAgents" uid="$(id -u "$(whoami)")" -test -d "$agent" +mkdir -p "$agent_dir" -for file in "$DOTFILES"/macOS/LaunchAgents/*.plist; do - filename="$(basename $file)" - path="$agent/$filename" - if ! test -e "$path"; then - echo "Installing Agent: $filename" - cp "$file" "$path" - launchctl enable "user/$uid/$filename" +for file in "${DOTFILES}"/macOS/LaunchAgents/*.plist; do + filename=$(basename "${file}") + path="${agent_dir}/${filename}" + if ! test -e "${path}"; then + echo "Installing Agent: ${filename}" + cp "${file}" "${path}" + launchctl enable "user/${uid}/${filename}" fi done