Switch to a simple boolean

This commit is contained in:
David Heinemeier Hansson
2025-09-13 19:19:52 +02:00
parent beb2e6b865
commit 51607f1978
5 changed files with 8 additions and 8 deletions

View File

@@ -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=' ▄▄▄
▄█████▄ ▄███████████▄ ▄███████ ▄███████ ▄███████ ▄█ █▄ ▄█ █▄

View File

@@ -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}"

View File

@@ -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

View File

@@ -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

View File

@@ -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