From 51607f197890a4c293d5acaa6d55caf5be1e10ea Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 13 Sep 2025 19:19:52 +0200 Subject: [PATCH] Switch to a simple boolean --- boot.sh | 2 +- install/config/mise-ruby.sh | 8 ++++---- install/helpers/errors.sh | 2 +- install/preflight/pacman.sh | 2 +- install/preflight/show-env.sh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boot.sh b/boot.sh index 4c44a53..9b6242e 100755 --- a/boot.sh +++ b/boot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Set install mode to online since boot.sh is used for curl installations -export OMARCHY_INSTALL_MODE="online" +export OMARCHY_ONLINE_INSTALL=true ansi_art=' ▄▄▄ ▄█████▄ ▄███████████▄ ▄███████ ▄███████ ▄███████ ▄█ █▄ ▄█ █▄ diff --git a/install/config/mise-ruby.sh b/install/config/mise-ruby.sh index 9404615..e23acd6 100644 --- a/install/config/mise-ruby.sh +++ b/install/config/mise-ruby.sh @@ -14,12 +14,12 @@ if [[ $(uname -m) == "x86_64" ]]; then mkdir -p "$MISE_RUBY_DIR" - if [[ ${OMARCHY_INSTALL_MODE:-offline} == "offline" ]]; then - echo "Installing Ruby from offline cache..." - tar -xzf "${OFFLINE_CACHE}/${RUBY_TARBALL}" -C "$MISE_RUBY_DIR" - else + if [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then echo "Downloading pre-built Ruby ${RUBY_VERSION}..." curl -fsSL "$RUBY_URL" | tar -xz -C "$MISE_RUBY_DIR" + else + echo "Installing Ruby from offline cache..." + tar -xzf "${OFFLINE_CACHE}/${RUBY_TARBALL}" -C "$MISE_RUBY_DIR" fi mise use --global "ruby@${RUBY_VERSION}" diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 0063783..6e18bbb 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -105,7 +105,7 @@ catch_errors() { options=() # If online install, show retry first - if [[ ${OMARCHY_INSTALL_MODE:-offline} == "online" ]]; then + if [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then options+=("Retry installation") fi diff --git a/install/preflight/pacman.sh b/install/preflight/pacman.sh index cc2d43f..1d9a2f2 100644 --- a/install/preflight/pacman.sh +++ b/install/preflight/pacman.sh @@ -1,4 +1,4 @@ -if [[ ${OMARCHY_INSTALL_MODE:-offline} == "online" ]]; then +if [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then # Install build tools sudo pacman -S --needed --noconfirm base-devel diff --git a/install/preflight/show-env.sh b/install/preflight/show-env.sh index 34ee076..1a9319d 100644 --- a/install/preflight/show-env.sh +++ b/install/preflight/show-env.sh @@ -1,6 +1,6 @@ # Show installation environment variables gum log --level info "Installation Environment:" -env | grep -E "^(OMARCHY_CHROOT_INSTALL|OMARCHY_INSTALL_MODE|OMARCHY_USER_NAME|OMARCHY_USER_EMAIL|USER|HOME|OMARCHY_REPO|OMARCHY_REF|OMARCHY_PATH)=" | sort | while IFS= read -r var; do +env | grep -E "^(OMARCHY_CHROOT_INSTALL|OMARCHY_ONLINE_INSTALL|OMARCHY_USER_NAME|OMARCHY_USER_EMAIL|USER|HOME|OMARCHY_REPO|OMARCHY_REF|OMARCHY_PATH)=" | sort | while IFS= read -r var; do gum log --level info " $var" done