mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-18 15:06:05 +00:00
fix: harden error handling and shell-agnostic mise activation
- Guard x-path call to prevent PATH clobber when missing - Make husky init.sh use shell-agnostic mise activate --shims - Add fail-fast to Tier 2 install steps in dfm install all - Check brew update exit status before reporting success - Always run mise install during reset_nvim (handles bootstrap) - Use double-bracket conditional in cleanup script
This commit is contained in:
@@ -20,8 +20,10 @@
|
||||
|
||||
# Bootstrap: ensure local/bin is on PATH so x-path is available
|
||||
PATH="$DOTFILES/local/bin:$PATH"
|
||||
# Use x-path to deduplicate PATH entries
|
||||
PATH="$(x-path prepend "$XDG_BIN_HOME" "$DOTFILES/local/bin" "/opt/homebrew/bin" "/usr/local/bin")"
|
||||
# Use x-path to deduplicate PATH entries (only if x-path is available)
|
||||
if command -v x-path &> /dev/null; then
|
||||
PATH="$(x-path prepend "$XDG_BIN_HOME" "$DOTFILES/local/bin" "/opt/homebrew/bin" "/usr/local/bin")"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
if ! command -v msg &> /dev/null; then
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
eval "$(mise activate bash --shims)"
|
||||
eval "$(mise activate --shims)"
|
||||
|
||||
@@ -105,9 +105,9 @@ section_install()
|
||||
$0 install fonts
|
||||
|
||||
# Tier 2: Runtimes and CLI tools via mise, then remaining installers
|
||||
$0 install mise
|
||||
$0 install composer
|
||||
$0 install python-libs
|
||||
$0 install mise || exit 1
|
||||
$0 install composer || exit 1
|
||||
$0 install python-libs || exit 1
|
||||
|
||||
# Tier 3: Tool-dependent installers
|
||||
$0 install cheat-databases
|
||||
@@ -268,8 +268,11 @@ section_brew()
|
||||
;;
|
||||
|
||||
update)
|
||||
brew update && brew outdated && brew upgrade && brew cleanup
|
||||
msgr yay "Done!"
|
||||
if brew update && brew outdated && brew upgrade && brew cleanup; then
|
||||
msgr yay "Done!"
|
||||
else
|
||||
msgr err "brew update failed"
|
||||
fi
|
||||
;;
|
||||
|
||||
updatebundle)
|
||||
@@ -548,7 +551,7 @@ section_dotfiles()
|
||||
msgr ok "Deleted old nvim files (share, state and cache + config)"
|
||||
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
|
||||
msgr ok "Linked nvim and astronvim"
|
||||
x-have mise && $0 install mise
|
||||
$0 install mise
|
||||
msgr ok "Installed packages"
|
||||
msgr run_done "nvim reset!"
|
||||
;;
|
||||
|
||||
@@ -5,7 +5,7 @@ set -euo pipefail
|
||||
# because nvim's Mason installs some of the same tool names.
|
||||
#
|
||||
# Ensure DOTFILES is set even when script is invoked directly
|
||||
if [ -z "${DOTFILES:-}" ]; then
|
||||
if [[ -z "${DOTFILES:-}" ]]; then
|
||||
DOTFILES="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
export DOTFILES
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user