aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schneider <thosch97@gmail.com>2015-02-15 16:44:52 +0100
committerThomas Schneider <thosch97@gmail.com>2015-02-15 16:44:52 +0100
commit03c3e7d51e768f1e2dcf9893a72a07bd195a5f59 (patch)
tree16b17bd7a7a7074999bcdd2d7c4950878fb748fb
parentc22976035dff3c9168538e3b0e5cf4f53a43a6d5 (diff)
Don’t break on FreeBSD
Signed-off-by: Thomas Schneider <thosch97@gmail.com>
-rwxr-xr-xsetup.zsh12
1 files changed, 11 insertions, 1 deletions
diff --git a/setup.zsh b/setup.zsh
index e46abc1..233a942 100755
--- a/setup.zsh
+++ b/setup.zsh
@@ -2,6 +2,16 @@
[[ $PWD = ~/.dotfiles ]] || exit 1
+if [[ $(uname -s) = FreeBSD ]]; then
+ if [[ -x /compat/linux/bin/ln ]]; then
+ LN=/compat/linux/bin/ln
+ else
+ echo "On FreeBSD and no GNU ln found, exiting"
+ exit 1
+ fi
+fi
+LN=${LN:-ln}
+
for i in dot.*; do
- ln -Ts .dotfiles/${i} ~/${i#dot}
+ ${LN} -Ts .dotfiles/${i} ~/${i#dot}
done