From 03ba75d9088167e186fbad0b7e4463eb89b1ac15 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 18 Mar 2026 15:19:33 +0200 Subject: [PATCH] fix: improve shell detection, curl flags, and cleanup robustness - Use ZSH_VERSION instead of ZSH_NAME for reliable zsh detection - Document NVIM_* env vars as optional external overrides - Add -fsSL flags to curl for mise bootstrap - Consolidate duplicate shellcheck directives in install-fonts.sh - Add explicit return 0 to cleanup script helper functions - Add actionable remediation to uv-not-found error message --- config/exports | 5 +++-- local/bin/dfm | 2 +- scripts/cleanup-old-version-managers.sh | 2 ++ scripts/install-fonts.sh | 1 - scripts/install-python-packages.sh | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/exports b/config/exports index 902edab..ecbd796 100755 --- a/config/exports +++ b/config/exports @@ -347,7 +347,8 @@ export AWS_CONFIGURE_SESSION_MFA=true msg "Setting up Mason configuration" export MASON_HOME="$XDG_DATA_HOME/nvim/mason" -# Neovim environment variables +# Neovim environment variables — optional overrides for external tools. +# Neovim itself uses vim.fn.stdpath() and does not read these. msg "Setting up Neovim configuration" [ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim" [ -z "${NVIM_CONFIG_HOME:-}" ] && export NVIM_CONFIG_HOME="$XDG_CONFIG_HOME/nvim" @@ -503,7 +504,7 @@ export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history" # mise — unified tool version manager # https://mise.jdx.dev if command -v mise &> /dev/null; then - if [ -n "${ZSH_NAME:-}" ]; then + if [ -n "${ZSH_VERSION:-}" ]; then eval "$(mise activate zsh)" else eval "$(mise activate bash)" diff --git a/local/bin/dfm b/local/bin/dfm index b6f177a..ad2d0d9 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -168,7 +168,7 @@ section_install() msgr run "Installing tools via mise..." if ! command -v mise &> /dev/null; then msgr nested "Installing mise..." - if ! curl https://mise.run | sh; then + if ! curl -fsSL https://mise.run | sh; then msgr err "Failed to install mise" exit 1 fi diff --git a/scripts/cleanup-old-version-managers.sh b/scripts/cleanup-old-version-managers.sh index feca1f7..1778cda 100755 --- a/scripts/cleanup-old-version-managers.sh +++ b/scripts/cleanup-old-version-managers.sh @@ -37,6 +37,7 @@ remove_dir() else msgr ok "$label not found (already clean): $dir" fi + return 0 } remove_file() @@ -51,6 +52,7 @@ remove_file() msgr run_done "Removed $label: $file" fi fi + return 0 } msgr msg "Cleaning up old version manager installations..." diff --git a/scripts/install-fonts.sh b/scripts/install-fonts.sh index efe2fcb..ddc1cca 100755 --- a/scripts/install-fonts.sh +++ b/scripts/install-fonts.sh @@ -51,7 +51,6 @@ install_fonts() { msgr run "Starting to install NerdFonts..." # shellcheck disable=SC2048,SC2086 - # shellcheck disable=SC2086 ./install.sh -q -s ${fonts[*]} \ && msgr run_done "Done" return 0 diff --git a/scripts/install-python-packages.sh b/scripts/install-python-packages.sh index ef27249..548d8ec 100755 --- a/scripts/install-python-packages.sh +++ b/scripts/install-python-packages.sh @@ -9,7 +9,7 @@ msgr run "Starting to install Python libraries" # Ensure uv is available if ! command -v uv &> /dev/null; then - msgr err "uv not found — install it via mise first" + msgr err "uv not found — install it via mise first (run: dfm install mise)" exit 1 fi