mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
fix: Pass both -y flag and env var to first_time_install.sh for non-interactive mode
Ensure first_time_install.sh runs in non-interactive mode by passing both: 1. The -y command-line flag 2. The LEDMATRIX_ASSUME_YES=1 environment variable This is necessary because first_time_install.sh re-executes itself with sudo if not running as root (line 131), and we need to ensure the non-interactive flag is preserved through the re-execution. Also added debug_install.sh diagnostic script to help troubleshoot installation failures on the Pi.
This commit is contained in:
@@ -273,13 +273,15 @@ main() {
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
chmod 1777 /tmp 2>/dev/null || true
|
||||
export TMPDIR=/tmp
|
||||
# Run in non-interactive mode with ASSUME_YES
|
||||
# Run in non-interactive mode with ASSUME_YES (both -y flag and env var for safety)
|
||||
export LEDMATRIX_ASSUME_YES=1
|
||||
bash ./first_time_install.sh -y
|
||||
else
|
||||
sudo chmod 1777 /tmp 2>/dev/null || true
|
||||
export TMPDIR=/tmp
|
||||
# Pass environment variable for non-interactive mode and preserve TMPDIR
|
||||
sudo -E env TMPDIR=/tmp LEDMATRIX_ASSUME_YES=1 bash ./first_time_install.sh
|
||||
# Pass both -y flag AND environment variable for non-interactive mode
|
||||
# This ensures it works even if the script re-executes itself with sudo
|
||||
sudo -E env TMPDIR=/tmp LEDMATRIX_ASSUME_YES=1 bash ./first_time_install.sh -y
|
||||
fi
|
||||
INSTALL_EXIT_CODE=$?
|
||||
set -e # Re-enable errexit
|
||||
|
||||
Reference in New Issue
Block a user