log polish

This commit is contained in:
shocknet-justin 2025-08-28 00:27:36 -04:00
parent 3cca4b4053
commit 8850c65091
3 changed files with 9 additions and 11 deletions

View file

@ -63,6 +63,8 @@ if [ "$OS" = "Mac" ]; then
log "Handling macOS specific setup" log "Handling macOS specific setup"
handle_macos || log_error "macOS setup failed" 1 handle_macos || log_error "macOS setup failed" 1
else 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_output=$(install_lnd)
install_result=$? install_result=$?
@ -71,15 +73,15 @@ else
fi fi
lnd_status=$(echo "$lnd_output" | grep "LND_STATUS:" | cut -d':' -f2) lnd_status=$(echo "$lnd_output" | grep "LND_STATUS:" | cut -d':' -f2)
case $lnd_status in case $lnd_status in
0) log "LND fresh installation completed successfully." ;; 0) log "LND fresh installation completed successfully." ;;
1) log "LND upgrade completed successfully." ;; 1) log "LND upgrade completed successfully." ;;
2) log "LND is already up-to-date. No action needed." ;; 2) log "LND is already up-to-date. No action needed." ;;
*) log "WARNING: Unexpected status from install_lnd: $lnd_status" ;; *) log "WARNING: Unexpected status from install_lnd: $lnd_status" ;;
esac esac
install_nodejs || log_error "Failed to install Node.js" 1 install_nodejs || log_error "Failed to install Node.js" 1
# Run install_lightning_pub and capture its exit code directly. # 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. # We expect specific exit codes (0 for success, 2 for no update), so we handle them.

View file

@ -16,8 +16,6 @@ install_lightning_pub() {
USER_HOME=$HOME USER_HOME=$HOME
USER_NAME=$(whoami) USER_NAME=$(whoami)
fi fi
log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}..."
wget -q $REPO_URL -O $USER_HOME/lightning_pub.tar.gz > /dev/null 2>&1 || { wget -q $REPO_URL -O $USER_HOME/lightning_pub.tar.gz > /dev/null 2>&1 || {
log "${PRIMARY_COLOR}Failed to download Lightning.Pub.${RESET_COLOR}" log "${PRIMARY_COLOR}Failed to download Lightning.Pub.${RESET_COLOR}"
@ -55,7 +53,7 @@ install_lightning_pub() {
return 2 return 2
fi fi
log "Upgrading existing Lightning.Pub installation..." log "${PRIMARY_COLOR}Upgrading${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} installation..."
upgrade_status=100 upgrade_status=100
log "Backing up user data before upgrade..." log "Backing up user data before upgrade..."
@ -90,7 +88,7 @@ install_lightning_pub() {
else else
# --- FRESH INSTALL PATH --- # --- FRESH INSTALL PATH ---
# This path is only taken if the ~/lightning_pub directory does not exist. # This path is only taken if the ~/lightning_pub directory does not exist.
log "Performing fresh Lightning.Pub installation..." log "${PRIMARY_COLOR}Installing${RESET_COLOR} ${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR}..."
upgrade_status=0 upgrade_status=0
mv "$USER_HOME/lightning_pub_temp" "$USER_HOME/lightning_pub" mv "$USER_HOME/lightning_pub_temp" "$USER_HOME/lightning_pub"
fi fi

View file

@ -36,10 +36,8 @@ install_nodejs() {
log "Node.js is not installed. ${PRIMARY_COLOR}Installing the LTS version...${RESET_COLOR}" log "Node.js is not installed. ${PRIMARY_COLOR}Installing the LTS version...${RESET_COLOR}"
fi fi
# Keep only the download progress bar; hide all other chatter # Silence all nvm output to keep installer logs clean
if ! bash -c "source ${NVM_DIR}/nvm.sh && nvm install --lts" \ if ! bash -c "source ${NVM_DIR}/nvm.sh && nvm install --lts" >/dev/null 2>&1; then
1>/dev/null \
2> >(grep -E '%\[' >&2); then
log "${PRIMARY_COLOR}Failed to install Node.js.${RESET_COLOR}" log "${PRIMARY_COLOR}Failed to install Node.js.${RESET_COLOR}"
return 1 return 1
fi fi