summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-07-03 19:56:30 +0100
committerAlan Pearce2014-07-03 19:56:30 +0100
commit75df2061a259258d85de7663d9f5e1dbc71a0ca8 (patch)
tree5022e27a91436520b7e01a782a2b920b21189114
parent1b2ac613e3ee291ddf37b16f01d82343906e5d39 (diff)
downloadnixfiles-75df2061a259258d85de7663d9f5e1dbc71a0ca8.tar.lz
nixfiles-75df2061a259258d85de7663d9f5e1dbc71a0ca8.tar.zst
nixfiles-75df2061a259258d85de7663d9f5e1dbc71a0ca8.zip
Fix zsh dotfile installation
-rwxr-xr-xhooks/post-up/zsh10
1 files changed, 9 insertions, 1 deletions
diff --git a/hooks/post-up/zsh b/hooks/post-up/zsh
index f4720813..938701fe 100755
--- a/hooks/post-up/zsh
+++ b/hooks/post-up/zsh
@@ -4,7 +4,15 @@ ZDOTDIR="${XDG_CONFIG_HOME:=~/.config}/zsh"
 pushd $ZDOTDIR
 for f in z*(-.)
 do
-	[[ -e .$f ]] || ln $f .$f
+	if [[ -e $f ]]
+	then
+		if [[ ! -h .$f ]]
+		then
+			echo "$f already exists as a regular file, ignoring"
+		fi
+	else
+		ln -s $f .$f
+	fi
 done
 popd