updated launcher + autoupdate

This commit is contained in:
2026-06-20 16:07:15 +04:00
parent 4997798453
commit e03b7bf6c5
3 changed files with 79 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
INSTALL_DIR="${HOME}/linusware"
INSTALL_DIR="${LINUSWARE_DIR:-${HOME}/linusware}"
RED='\033[0;31m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
@@ -40,6 +40,26 @@ run_updater() {
read -rp "Press Enter to return to menu..." _
}
auto_update() {
[ -x "${INSTALL_DIR}/update.sh" ] && "${INSTALL_DIR}/update.sh"
}
# --- startup ---
auto_update
if [ $# -ge 1 ]; then
arg="$1"
for i in "${!edition_names[@]}"; do
name_lc=$(echo "${edition_names[$i]}" | tr '[:upper:]' '[:lower:]')
arg_lc=$(echo "$arg" | tr '[:upper:]' '[:lower:]')
if [ "$arg_lc" = "$name_lc" ]; then
exec "${editions[$i]}"
fi
done
echo -e "${RED}Unknown edition: $arg${NC}" >&2
exit 1
fi
# whiptail TUI
if command -v whiptail >/dev/null 2>&1; then
while true; do