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
This commit is contained in:
2026-03-18 15:19:33 +02:00
parent e918a41d75
commit 03ba75d908
5 changed files with 7 additions and 5 deletions

View File

@@ -347,7 +347,8 @@ export AWS_CONFIGURE_SESSION_MFA=true
msg "Setting up Mason configuration" msg "Setting up Mason configuration"
export MASON_HOME="$XDG_DATA_HOME/nvim/mason" 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" msg "Setting up Neovim configuration"
[ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim" [ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim"
[ -z "${NVIM_CONFIG_HOME:-}" ] && export NVIM_CONFIG_HOME="$XDG_CONFIG_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 # mise — unified tool version manager
# https://mise.jdx.dev # https://mise.jdx.dev
if command -v mise &> /dev/null; then if command -v mise &> /dev/null; then
if [ -n "${ZSH_NAME:-}" ]; then if [ -n "${ZSH_VERSION:-}" ]; then
eval "$(mise activate zsh)" eval "$(mise activate zsh)"
else else
eval "$(mise activate bash)" eval "$(mise activate bash)"

View File

@@ -168,7 +168,7 @@ section_install()
msgr run "Installing tools via mise..." msgr run "Installing tools via mise..."
if ! command -v mise &> /dev/null; then if ! command -v mise &> /dev/null; then
msgr nested "Installing mise..." 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" msgr err "Failed to install mise"
exit 1 exit 1
fi fi

View File

@@ -37,6 +37,7 @@ remove_dir()
else else
msgr ok "$label not found (already clean): $dir" msgr ok "$label not found (already clean): $dir"
fi fi
return 0
} }
remove_file() remove_file()
@@ -51,6 +52,7 @@ remove_file()
msgr run_done "Removed $label: $file" msgr run_done "Removed $label: $file"
fi fi
fi fi
return 0
} }
msgr msg "Cleaning up old version manager installations..." msgr msg "Cleaning up old version manager installations..."

View File

@@ -51,7 +51,6 @@ install_fonts()
{ {
msgr run "Starting to install NerdFonts..." msgr run "Starting to install NerdFonts..."
# shellcheck disable=SC2048,SC2086 # shellcheck disable=SC2048,SC2086
# shellcheck disable=SC2086
./install.sh -q -s ${fonts[*]} \ ./install.sh -q -s ${fonts[*]} \
&& msgr run_done "Done" && msgr run_done "Done"
return 0 return 0

View File

@@ -9,7 +9,7 @@ msgr run "Starting to install Python libraries"
# Ensure uv is available # Ensure uv is available
if ! command -v uv &> /dev/null; then 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 exit 1
fi fi