fix: fixes bug in symlinking git hooks
This commit is contained in:
parent
34671bfd42
commit
f09429ba93
10
bin/dotf
10
bin/dotf
@ -23,16 +23,16 @@ secrets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ensure_git_hooks() {
|
ensure_git_hooks() {
|
||||||
# If .git/hooks is a symlink, skip this
|
# If ~/dotfiles/.git/hooks is a symlink, skip this
|
||||||
if [[ -L .git/hooks ]]; then
|
if [[ -L ~/dotfiles/.git/hooks ]]; then
|
||||||
# Let's make sure the symlink is correct
|
# Let's make sure the symlink is correct
|
||||||
if [[ $(readlink .git/hooks) != ~/dotfiles/bin/actions/git ]]; then
|
if [[ $(readlink ~/dotfiles/.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."
|
printfe "%s\n" "yellow" "The ~/dotfiles/.git/hooks symlink is incorrect. Please remove it and run this script again."
|
||||||
fi
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d .git/hooks ]]; then
|
if [[ -d ~/dotfiles/.git/hooks ]]; then
|
||||||
rm -rf ~/dotfiles/.git/hooks
|
rm -rf ~/dotfiles/.git/hooks
|
||||||
printfe "%s\n" "yellow" "The ~/dotfiles/.git/hooks directory already exists. We're removing it!"
|
printfe "%s\n" "yellow" "The ~/dotfiles/.git/hooks directory already exists. We're removing it!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user