v0.0.37 - Fix install.sh: read confirmation from /dev/tty, fix color rendering in summary

This commit is contained in:
Laan Tungir
2026-07-17 11:55:42 -04:00
parent 7ca05baff1
commit b111fffeaa
3 changed files with 21 additions and 13 deletions
+1 -1
View File
@@ -1 +1 @@
0.0.36
0.0.37
+18 -10
View File
@@ -413,18 +413,26 @@ main() {
local method="prebuilt binary from Gitea"
$BUILD_FROM_SOURCE && method="source build from $SB_REPO"
cat >&2 <<EOF
${BLUE}[INFO]${NC} sovereign_browser will be installed:
${BLUE}[INFO]${NC} Install prefix : $INSTALL_PREFIX
${BLUE}[INFO]${NC} Binary method : $method
${BLUE}[INFO]${NC} FIPS : built from source ($FIPS_REPO), CAP_NET_ADMIN set
${BLUE}[INFO]${NC} Tor : apt package 'tor'
${BLUE}[INFO]${NC} apt deps : ${APT_PACKAGES[*]}
EOF
# Use print_info so colors render via `echo -e` (a plain `cat` heredoc
# would print the literal \033 escape sequences).
print_info "sovereign_browser will be installed:"
print_info " Install prefix : $INSTALL_PREFIX"
print_info " Binary method : $method"
print_info " FIPS : built from source ($FIPS_REPO), CAP_NET_ADMIN set"
print_info " Tor : apt package 'tor'"
print_info " apt deps : ${APT_PACKAGES[*]}"
if ! $ASSUME_YES; then
echo -e "${YELLOW}[WARNING]${NC} This will run apt-get install (sudo) and clone/build FIPS. Continue? [y/N] " >&2
read -r reply || reply=""
print_warning "This will run apt-get install (sudo) and clone/build FIPS. Continue? [y/N]"
# Read from /dev/tty, not stdin: in `curl | bash` mode stdin is the
# curl pipe (the script text), so a plain `read` would hit EOF and
# abort immediately. /dev/tty is the user's terminal.
if [[ -r /dev/tty ]]; then
read -r reply < /dev/tty || reply=""
else
# No tty available (e.g. non-interactive CI) — require --yes.
die "No tty available for confirmation. Re-run with --yes to skip prompts."
fi
reply="${reply:-n}"
if [[ ! "${reply,,}" =~ ^y(es)?$ ]]; then
die "Aborted by user."
+2 -2
View File
@@ -11,9 +11,9 @@
#ifndef SOVEREIGN_BROWSER_VERSION_H
#define SOVEREIGN_BROWSER_VERSION_H
#define SB_VERSION "v0.0.36"
#define SB_VERSION "v0.0.37"
#define SB_VERSION_MAJOR 0
#define SB_VERSION_MINOR 0
#define SB_VERSION_PATCH 36
#define SB_VERSION_PATCH 37
#endif /* SOVEREIGN_BROWSER_VERSION_H */