Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ _scheduler_detect_installed() {

return 1
}

# Spinner for long-running operations
# Usage: run_with_spinner "Installing package..." command arg1 arg2
run_with_spinner() {
Expand Down Expand Up @@ -672,6 +671,8 @@ main() {
bootstrap_repo "$@"

parse_args "$@"
local _os
_os="$(uname -s)"

# Auto-detect non-interactive terminals (CI/CD, agent shells, piped stdin)
# Must run after parse_args so explicit --interactive flag takes precedence
Expand Down Expand Up @@ -877,7 +878,7 @@ main() {
#
# Ensure crontab has a global PATH= line (Linux only; macOS uses launchd env).
# Must run before any cron entries are installed so they inherit the PATH.
if [[ "$PLATFORM_MACOS" != "true" ]]; then
if [[ "$_os" != "Darwin" ]]; then
_ensure_cron_path
fi

Expand Down Expand Up @@ -967,6 +968,7 @@ main() {
fi

# Detect if pulse is already installed (for upgrade messaging)
# Uses shared helper to check both launchd and cron consistently
local _pulse_installed=false
if _scheduler_detect_installed \
"Supervisor pulse" \
Expand All @@ -986,7 +988,7 @@ main() {
if [[ "$_do_install" == "true" ]]; then
mkdir -p "$HOME/.aidevops/logs"

if [[ "$(uname -s)" == "Darwin" ]]; then
if [[ "$_os" == "Darwin" ]]; then
# macOS: use launchd plist with wrapper
local pulse_plist="$HOME/Library/LaunchAgents/${pulse_label}.plist"

Expand Down Expand Up @@ -1113,7 +1115,7 @@ PLIST
fi
elif [[ "$_pulse_lower" == "false" && "$_pulse_installed" == "true" ]]; then
# User explicitly disabled but pulse is still installed — clean up
if [[ "$(uname -s)" == "Darwin" ]]; then
if [[ "$_os" == "Darwin" ]]; then
local pulse_plist="$HOME/Library/LaunchAgents/${pulse_label}.plist"
if _launchd_has_agent "$pulse_label"; then
launchctl unload "$pulse_plist" || true
Expand Down
Loading