From dec5a5c10b8fd57db6e933fa3603d72b13c93c18 Mon Sep 17 00:00:00 2001 From: Alec Rust Date: Mon, 29 Jan 2024 14:28:44 +0000 Subject: [PATCH] Switch to new husky config file https://github.com/typicode/husky/releases/tag/v9.0.1 https://typicode.github.io/husky/how-to.html#node-version-managers-and-guis --- configs/husky/init.sh | 5 +++++ dotfiles/.huskyrc | 2 +- scripts/shell.sh | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 configs/husky/init.sh diff --git a/configs/husky/init.sh b/configs/husky/init.sh new file mode 100644 index 0000000..c04b51c --- /dev/null +++ b/configs/husky/init.sh @@ -0,0 +1,5 @@ +# Runs before husky hooks, in non-interative shell environments like Sourcetree +# https://typicode.github.io/husky/how-to.html#node-version-managers-and-guis + +# Add mise shims to PATH +export PATH="$HOME/.local/share/mise/shims:$PATH" diff --git a/dotfiles/.huskyrc b/dotfiles/.huskyrc index 463fd8f..d2889d0 100644 --- a/dotfiles/.huskyrc +++ b/dotfiles/.huskyrc @@ -1,5 +1,5 @@ # Runs before husky hooks, in non-interative shell environments like Sourcetree -# https://typicode.github.io/husky/troubleshooting.html#command-not-found +# TODO: Remove this file when all your projects are using husky v9 # Add mise shims to PATH export PATH="$HOME/.local/share/mise/shims:$PATH" diff --git a/scripts/shell.sh b/scripts/shell.sh index 2e1a3f6..3222eeb 100755 --- a/scripts/shell.sh +++ b/scripts/shell.sh @@ -12,6 +12,8 @@ for file in "$REPO_PATH"/dotfiles/.*; do done # Symlink mise and Starship configs +mkdir -p "$HOME/.config/husky" +ln -sf "$REPO_PATH/configs/husky/init.sh" "$HOME/.config/husky/init.sh" mkdir -p "$HOME/.config/mise" ln -sf "$REPO_PATH/configs/mise/config.toml" "$HOME/.config/mise/config.toml" ln -sf "$REPO_PATH/configs/mise/settings.toml" "$HOME/.config/mise/settings.toml"