diff --git a/scripts/install.sh b/scripts/install.sh index f1aab95c..9c8d6a01 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -93,7 +93,7 @@ else install_nodejs || log_error "Failed to install Node.js" 1 # Run install_lightning_pub and capture its exit code directly. - # We expect specific exit codes (0 for success, 2 for no update), so we handle them. + # Exit codes from install_lightning_pub: 0=fresh, 100=upgrade, 2=no-op install_lightning_pub "$REPO_URL" pub_install_status=$? diff --git a/scripts/install_lightning_pub.sh b/scripts/install_lightning_pub.sh index 436d7fa8..963d5fc7 100755 --- a/scripts/install_lightning_pub.sh +++ b/scripts/install_lightning_pub.sh @@ -2,6 +2,11 @@ install_lightning_pub() { local REPO_URL="$1" + # Defined exit codes for this function: + # 0: Fresh install success (triggers service start) + # 100: Upgrade success (triggers service restart) + # 2: No-op (already up-to-date, skip services) + # Other: Error local upgrade_status=0 if [ -z "$REPO_URL" ]; then @@ -36,8 +41,6 @@ install_lightning_pub() { fi LATEST_COMMIT=$(echo "$API_RESPONSE" | awk -F'[/"]' '/"html_url": ".*\/commit\// {print $(NF-1); exit}') if [ -z "$LATEST_COMMIT" ]; then - log "GitHub API response was not as expected. Full response for debugging:" - log "$API_RESPONSE" log_error "Could not retrieve latest version from GitHub. Upgrade check failed. Aborting." 1 fi diff --git a/scripts/start_services.sh b/scripts/start_services.sh index e19fb1d1..efccc625 100755 --- a/scripts/start_services.sh +++ b/scripts/start_services.sh @@ -91,8 +91,8 @@ start_services() { log "systemctl not available. Please start the services manually (e.g., run lnd and npm start in separate terminals)." fi elif [ "$OS" = "Mac" ]; then - # NOTE: macOS support is untested and unsupported. Use at your own risk. - log "macOS detected. Please configure launchd manually to start ${SECONDARY_COLOR}LND${RESET_COLOR} and ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} at startup." + # NOTE: macOS support is untested and unsupported. Use at your own risk. (restore) + log "macOS detected. Please configure launchd manually..." elif [ "$OS" = "Cygwin" ] || [ "$OS" = "MinGw" ]; then log "Windows detected. Please configure your startup scripts manually to start ${SECONDARY_COLOR}LND${RESET_COLOR} and ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} at startup." else