feat: paru auto-install + ASCII Header + Continue-Prompt
- paru wird jetzt in detect_environment() auf frischen Systemen installiert
(vorher nur in preflight, das bei --fresh nie durchlief)
- install_aur_helper() von preflight nach utils.sh verschoben (global verfügbar)
- Header von Cherokee-Zeichen ('Ꮎ Ꮇ Ꭼ Ꮢ Ꮎ Ꮑ') auf ASCII ('O M E R O N')
umgestellt — Cherokee zeigte auf manchen Terminals Fragezeichen
- Continue with installation? Prompt nach Banner als erster interaktiver Schritt
- basic mode header jetzt sauberes ASCII (===== statt Box-Zeichen)
This commit is contained in:
@@ -187,20 +187,17 @@ tui_spin() {
|
||||
|
||||
tui_header() {
|
||||
local title="$(_strip_format "$1")"
|
||||
local len="${#title}"
|
||||
|
||||
if [[ "$OMERON_TUI_MODE" == "gum" ]]; then
|
||||
gum style --foreground 212 --border-foreground 212 --border double --align center --width 60 --margin "1 2" --padding "1 2" "$title"
|
||||
else
|
||||
local width=50
|
||||
local pad=$(( (width - len) / 2 ))
|
||||
[[ $pad -lt 2 ]] && pad=2
|
||||
|
||||
local line
|
||||
printf -v line '%*s' "$width" '' && line="${line// /═}"
|
||||
printf -v line '%*s' "$width" '' && line="${line// /#}"
|
||||
line="${line//#/=}"
|
||||
printf '\n'
|
||||
printf '\033[1;36m%s\033[0m\n' "$line"
|
||||
printf '\033[1;36m║\033[0m%*s%s%*s\033[1;36m║\033[0m\n' $pad '' "$title" $((width - pad - len)) ''
|
||||
printf '\033[1;36m %s\033[0m\n' "$title"
|
||||
printf '\033[1;36m%s\033[0m\n' "$line"
|
||||
printf '\n'
|
||||
fi
|
||||
|
||||
32
lib/utils.sh
32
lib/utils.sh
@@ -261,3 +261,35 @@ system_summary() {
|
||||
└─────────────────────────────────────────────┘
|
||||
SUMMARY
|
||||
}
|
||||
|
||||
install_aur_helper() {
|
||||
if have paru || have yay; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
sudo_run pacman -S --needed --noconfirm git base-devel
|
||||
fi
|
||||
|
||||
local build_dir
|
||||
build_dir="$(mktemp -d)"
|
||||
|
||||
sudo_run pacman -S --needed --noconfirm rustup 2>/dev/null || true
|
||||
|
||||
if have rustup; then
|
||||
rustup default stable >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
if git clone https://aur.archlinux.org/paru.git "$build_dir/paru" 2>/dev/null; then
|
||||
(cd "$build_dir/paru" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
|
||||
tui_warn "paru build failed, trying yay..."
|
||||
if git clone https://aur.archlinux.org/yay.git "$build_dir/yay" 2>/dev/null; then
|
||||
(cd "$build_dir/yay" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
|
||||
tui_warn "yay build failed too. Install manually: paru -S paru-bin"
|
||||
}
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
rm -rf "$build_dir"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user