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:
12
nanoclaw.sh
12
nanoclaw.sh
@@ -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")"
|
"$(dim "Running NanoClaw as root is not recommended. It can cause permission")"
|
||||||
printf ' %s\n\n' \
|
printf ' %s\n\n' \
|
||||||
"$(dim "issues with containers, services, and file ownership.")"
|
"$(dim "issues with containers, services, and file ownership.")"
|
||||||
printf ' %s\n' \
|
printf ' %s\n' "$(bold '1)') $(dim 'Show me instructions for creating a new Linux user')"
|
||||||
"$(dim "We recommend creating a regular user and running setup from there.")"
|
printf ' %s\n\n' "$(bold '2)') $(dim 'Continue setting up NanoClaw as root user (not recommended)')"
|
||||||
printf ' %s\n\n' \
|
read -r -p " $(bold 'Choose [1/2]: ')" ROOT_ANS </dev/tty
|
||||||
"$(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
|
|
||||||
|
|
||||||
case "${ROOT_ANS:-N}" in
|
case "${ROOT_ANS:-1}" in
|
||||||
[Yy]*)
|
2)
|
||||||
ph_event setup_root_continued
|
ph_event setup_root_continued
|
||||||
printf '\n'
|
printf '\n'
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user