summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/config-symlinks (renamed from .config/symlinks.sh)6
1 files changed, 3 insertions, 3 deletions
diff --git a/.config/symlinks.sh b/.local/bin/config-symlinks
index a3db6ae..0831ca3 100755
--- a/.config/symlinks.sh
+++ b/.local/bin/config-symlinks
@@ -1,7 +1,7 @@
#!/bin/bash
-sed -e '/^\s*$/d' -e '/#/d' symlinks | while read _path _link; do
- path="$(sed -rn 's|[^/]+/|../|g;s|/[^/]+$|/|p' <<<"$_link")${_path}"
+sed -e '/^\s*$/d' -e '/#/d' symlinks | while read _target _link; do
+ target="$(sed -rn 's|[^/]+/|../|g;s|/[^/]+$|/|p' <<<"$_link")${_target}"
link="$HOME/$_link"
if [[ -L "$link" ]]; then
rm -f "$link"
@@ -10,6 +10,6 @@ sed -e '/^\s*$/d' -e '/#/d' symlinks | while read _path _link; do
echo "ERROR: file exists: $link" >> /dev/stderr
else
mkdir -p "${link%/*}"
- ln -s "$path" "$link"
+ ln -s "$target" "$link"
fi
done