Skip to content

Commit 54ed986

Browse files
authored
[FIX] Updating deprecated husky location (#23)
## Problem I've been experiencing issues while running the pre-commit hook in the Galaxy Repo. Husky is deprecating the usage of the route `~/.huskyrc` They are suggesting the usage of a new route. ## Solution Owners are suggesting to stop using the route I mentioned before and using `~/.config/husky/init.sh` instead https://github.com/typicode/husky/blob/a2d942a670b3d6a04578005a0fd2dc310e511849/husky#L9 After implementing these changes everything is working smoothly. These alerts started being announced since the v8. ![image](https://github.com/user-attachments/assets/6d44e9a4-2ec0-4162-ab98-8c9e62b16b74) ### References https://typicode.github.io/husky/how-to.html#startup-files https://typicode.github.io/husky/how-to.html#solution ## Proof <img width="386" alt="image" src="https://github.com/user-attachments/assets/1198145a-f7a5-4881-a570-fa26b3976666">
1 parent 7317868 commit 54ed986

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

setup-new-computer.sh

+11-8
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ EOT
248248
}
249249

250250

251-
writetoHuskrc() {
252-
cat << EOT >> ~/.huskyrc
251+
writetoHuskyInit() {
252+
cat << EOT >> ~/.config/husky/init.sh
253253
254254
255255
# --------------------------------------------------------------------
@@ -493,15 +493,18 @@ printHeading "Installing Node and Angular CLI through NVM"
493493
printStep "Node Sass" "npm install --location=global sass"
494494
printStep "Node Gyp" "npm install --location=global node-gyp"
495495
printDivider
496-
echo "✔ Touch ~/.huskyrc"
497-
touch ~/.huskyrc
496+
echo "✔ Ensure ~/.config/husky directory exists"
497+
mkdir -p ~/.config/husky
498+
printDivider
499+
echo "✔ Touch ~/.config/husky/init.sh"
500+
touch ~/.config/husky/init.sh
498501
printDivider
499502
# Husky profile
500-
if grep --quiet "nvm" ~/.huskyrc; then
501-
echo ".huskyrc already includes nvm. Skipping"
503+
if grep --quiet "nvm" ~/.config/husky/init.sh; then
504+
echo "~/.config/husky/init.sh already includes nvm. Skipping"
502505
else
503-
writetoHuskrc
504-
echo "✔ Add nvm to .huskyrc"
506+
writetoHuskyInit
507+
echo "✔ Add nvm to ~/.config/husky/init.sh"
505508
fi
506509
printDivider
507510

0 commit comments

Comments
 (0)