mirror of
https://github.com/smittix/intercept.git
synced 2026-07-09 10:08:12 -07:00
Improve apt_install error handling in setup script
Show actual error output when apt-get fails instead of silently failing. Now displays which packages failed, the last 10 lines of apt output, and suggests a manual fix command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -287,7 +287,18 @@ install_macos_packages() {
|
|||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Debian/Ubuntu install (APT)
|
# Debian/Ubuntu install (APT)
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
apt_install() { $SUDO apt-get install -y --no-install-recommends "$@" >/dev/null; }
|
apt_install() {
|
||||||
|
local pkgs="$*"
|
||||||
|
local output
|
||||||
|
local ret=0
|
||||||
|
output=$($SUDO apt-get install -y --no-install-recommends "$@" 2>&1) || ret=$?
|
||||||
|
if [[ $ret -ne 0 ]]; then
|
||||||
|
fail "Failed to install: $pkgs"
|
||||||
|
echo "$output" | tail -10
|
||||||
|
fail "Try running: sudo apt-get update && sudo apt-get install -y $pkgs"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
apt_try_install_any() {
|
apt_try_install_any() {
|
||||||
local p
|
local p
|
||||||
|
|||||||
Reference in New Issue
Block a user