Change root warning from y/N prompt to numbered menu options

Clearer UX: option 1 shows user creation instructions,
option 2 explicitly continues as root (not recommended).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Koshkoshinsk
2026-04-29 12:08:22 +00:00
parent 7755082a4c
commit c4f654083d

View File

@@ -142,14 +142,12 @@ if [ "$(uname -s)" = "Linux" ] && [ "$(id -u)" -eq 0 ]; then
"$(dim "Running NanoClaw as root is not recommended. It can cause permission")"
printf ' %s\n\n' \
"$(dim "issues with containers, services, and file ownership.")"
printf ' %s\n' \
"$(dim "We recommend creating a regular user and running setup from there.")"
printf ' %s\n\n' \
"$(dim "If you continue as root, some things may not work as expected.")"
read -r -p " $(bold 'Continue as root anyway?') [y/N] " ROOT_ANS </dev/tty
printf ' %s\n' "$(bold '1)') $(dim 'Show me instructions for creating a new Linux user')"
printf ' %s\n\n' "$(bold '2)') $(dim 'Continue setting up NanoClaw as root user (not recommended)')"
read -r -p " $(bold 'Choose [1/2]: ')" ROOT_ANS </dev/tty
case "${ROOT_ANS:-N}" in
[Yy]*)
case "${ROOT_ANS:-1}" in
2)
ph_event setup_root_continued
printf '\n'
;;