summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--link.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/link.sh b/link.sh
index d74f4788..6763f2e0 100644
--- a/link.sh
+++ b/link.sh
@@ -1,10 +1,15 @@
 #!/bin/sh
 set -eu
 
+die() {
+	echo "$*"
+	exit 1
+}
+
 if [ $# -eq 1 ]; then
 	link=$1
 	file="${PWD}/home/${link#${HOME}/}"
-	[ ! -f "$file" ]
+	[ ! -f "$file" ] || die "${file} exists"
 	mkdir -p "${file%/*}"
 	mv "$link" "$file"
 fi
@@ -13,6 +18,6 @@ find home -type f | while read -r find; do
 	file="${PWD}/${find}"
 	link="${HOME}/${find#home/}"
 	mkdir -p "${link%/*}"
-	[ \( -f "$link" -a -L "$link" \) -o ! -f "$link" ]
+	[ \( -f "$link" -a -L "$link" \) -o ! -f "$link" ] || die "${link} exists"
 	ln -fs "$file" "$link"
 done
6102c3c7ef0cecc6e83cb1730909b&follow=1'>tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe