fix(scripts): standardize source paths and quoting

- install-composer.sh: use $DOTFILES instead of $HOME/.dotfiles
- install-macos-defaults.sh: use $DOTFILES, replace which with command -v
- install-xcode-cli-tools.sh: quote command substitution
- create-nvim-keymaps.sh: quote $DEST in nvim redir command
This commit is contained in:
2026-02-05 22:53:04 +02:00
parent de773ad68f
commit 81190c051a
4 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ main()
printf "\`\`\`txt" printf "\`\`\`txt"
} > "$DEST" } > "$DEST"
nvim -c "redir! >> $DEST" -c 'silent verbose map' -c 'redir END' -c 'q' nvim -c "redir! >> \"$DEST\"" -c 'silent verbose map' -c 'redir END' -c 'q'
printf "\n\`\`\`\n\n- Generated on %s\n" "$(date)" >> "$DEST" printf "\n\`\`\`\n\n- Generated on %s\n" "$(date)" >> "$DEST"

View File

@@ -3,7 +3,7 @@ set -euo pipefail
# @description Install PHP Package Manager Composer # @description Install PHP Package Manager Composer
# #
# shellcheck source="shared.sh" # shellcheck source="shared.sh"
source "$HOME/.dotfiles/config/shared.sh" source "$DOTFILES/config/shared.sh"
if ! command -v php &> /dev/null; then if ! command -v php &> /dev/null; then
msg_err "PHP Not Available, cannot install composer" msg_err "PHP Not Available, cannot install composer"

View File

@@ -8,7 +8,7 @@ set -uo pipefail
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0 [ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/config/shared.sh" source "$DOTFILES/config/shared.sh"
msgr run "Starting to set macOS defaults, these require sudo privileges:" msgr run "Starting to set macOS defaults, these require sudo privileges:"
@@ -24,12 +24,12 @@ while true; do
done 2> /dev/null & done 2> /dev/null &
# Skip when shell is fish # Skip when shell is fish
if [[ $SHELL != $(which fish) ]]; then if [[ $SHELL != "$(command -v fish)" ]]; then
msgr nested "Change user shell to zsh if it is available and not the current" msgr nested "Change user shell to zsh if it is available and not the current"
# Change user shell to zsh if not that already. # Change user shell to zsh if not that already.
if hash zsh 2> /dev/null; then if hash zsh 2> /dev/null; then
[[ $SHELL != $(which zsh) ]] && chsh -s "$(which zsh)" [[ $SHELL != "$(command -v zsh)" ]] && chsh -s "$(command -v zsh)"
fi fi
fi fi

View File

@@ -32,7 +32,7 @@ keep_alive_sudo()
done 2> /dev/null & done 2> /dev/null &
} }
XCODE_TOOLS_PATH=$(xcode-select -p) XCODE_TOOLS_PATH="$(xcode-select -p)"
XCODE_SWIFT_PATH="$XCODE_TOOLS_PATH/usr/bin/swift" XCODE_SWIFT_PATH="$XCODE_TOOLS_PATH/usr/bin/swift"
# Function to prompt for XCode CLI Tools installation # Function to prompt for XCode CLI Tools installation