mac debug

This commit is contained in:
shocknet-justin 2025-11-26 13:41:40 -05:00
parent f138b71406
commit 6dc313e3c0
3 changed files with 19 additions and 11 deletions

View file

@ -17,15 +17,17 @@ handle_macos() {
# Install LND
log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}LND${RESET_COLOR}..."
lnd_output=$(install_lnd)
LND_STATUS_FILE=$(mktemp)
install_lnd "$LND_STATUS_FILE"
install_result=$?
if [ $install_result -ne 0 ]; then
printf "%s\n" "$lnd_output"
rm -f "$LND_STATUS_FILE"
log_error "LND installation failed" $install_result
fi
lnd_status=$(echo "$lnd_output" | grep "LND_STATUS:" | cut -d':' -f2)
lnd_status=$(cat "$LND_STATUS_FILE")
rm -f "$LND_STATUS_FILE"
case $lnd_status in
0) log "LND fresh installation completed successfully." ;;

View file

@ -110,15 +110,17 @@ if [ "$OS" = "Mac" ]; then
else
# Explicit kickoff log for LND so the flow is clear in the install log
log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}LND${RESET_COLOR}..."
lnd_output=$(install_lnd)
LND_STATUS_FILE=$(mktemp)
install_lnd "$LND_STATUS_FILE"
install_result=$?
if [ $install_result -ne 0 ]; then
printf "%s\n" "$lnd_output"
rm -f "$LND_STATUS_FILE"
log_error "LND installation failed" $install_result
fi
lnd_status=$(echo "$lnd_output" | grep "LND_STATUS:" | cut -d':' -f2)
lnd_status=$(cat "$LND_STATUS_FILE")
rm -f "$LND_STATUS_FILE"
case $lnd_status in
0) log "LND fresh installation completed successfully." ;;

View file

@ -1,6 +1,7 @@
#!/bin/bash
install_lnd() {
local status_file="$1"
local lnd_status=0
log "Starting LND installation/check process..."
@ -134,7 +135,10 @@ install_lnd() {
fi
log "LND installation/check process complete. Status: $lnd_status"
# Echo the LND status
echo "LND_STATUS:$lnd_status"
if [ -n "$status_file" ]; then
echo "$lnd_status" > "$status_file"
fi
return 0 # Always return 0 to indicate success
}