fix: prompt for sudo password upfront to ensure smooth installation process

This commit is contained in:
Даниил Грабарь
2026-05-22 11:56:05 +10:00
parent 17b1425c78
commit e24f97b12d
+12
View File
@@ -330,6 +330,18 @@ run_setup() {
main() { main() {
print_banner print_banner
# Ask for the sudo password upfront before anything else runs.
# This way all later sudo calls work silently without interrupting the flow.
# Skip if we are already root - no password needed in that case.
# Запрашиваем пароль sudo в самом начале, до запуска всего остального.
# Тогда все последующие sudo-вызовы работают молча, не прерывая процесс.
# Пропускаем если уже запущены от root - пароль в этом случае не нужен.
if [ "$(id -u)" -ne 0 ]; then
log_info "Some steps require administrator privileges. Please enter your password:"
sudo -v || log_error "sudo authentication failed"
fi
detect_os detect_os
check_git check_git
check_docker check_docker