From f09429ba939c72cb8bde8714ce0f54804d377ad8 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Thu, 22 Aug 2024 23:57:28 +0200 Subject: [PATCH] fix: fixes bug in symlinking git hooks --- bin/dotf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/dotf b/bin/dotf index f3ea761..7827d2f 100755 --- a/bin/dotf +++ b/bin/dotf @@ -23,16 +23,16 @@ secrets() { } ensure_git_hooks() { - # If .git/hooks is a symlink, skip this - if [[ -L .git/hooks ]]; then + # If ~/dotfiles/.git/hooks is a symlink, skip this + if [[ -L ~/dotfiles/.git/hooks ]]; then # Let's make sure the symlink is correct - if [[ $(readlink .git/hooks) != ~/dotfiles/bin/actions/git ]]; then - printfe "%s\n" "yellow" "The .git/hooks symlink is incorrect. Please remove it and run this script again." + if [[ $(readlink ~/dotfiles/.git/hooks) != ~/dotfiles/bin/actions/git ]]; then + printfe "%s\n" "yellow" "The ~/dotfiles/.git/hooks symlink is incorrect. Please remove it and run this script again." fi return fi - if [[ -d .git/hooks ]]; then + if [[ -d ~/dotfiles/.git/hooks ]]; then rm -rf ~/dotfiles/.git/hooks printfe "%s\n" "yellow" "The ~/dotfiles/.git/hooks directory already exists. We're removing it!" fi