From f1c4d798251a5bac90ccd289da1dec7839beafe8 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 10 Aug 2024 02:41:22 -0400 Subject: add linking --- auto. | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'auto.') diff --git a/auto. b/auto. index e258cf5..db94de5 100755 --- a/auto. +++ b/auto. @@ -178,5 +178,22 @@ while read -r line || return 0; do [ $install ] && cp -rv -- "$sourcef" "$destf" [ $uninstall ] && rm -rv -- "$destf" fi + + # remove/link a file + elif printf "%s" "$line" | grep -q -- "~>"; then + # get the path of the file + sourcef=$(eval echo "${line%% *->*}") + + # get the destination for the file + destf=$(eval echo "${line##*->* }") + + # install/uninstall + if printf "%s" "$line" | grep -q -- "#~>"; then + [ $install ] && dort ln -sv -- "$sourcef" "$destf" + [ $uninstall ] && dort rm -v -- "$destf" + else + [ $install ] && ln -sv -- "$sourcef" "$destf" + [ $uninstall ] && rm -rv -- "$destf" + fi fi done < "$topography" -- cgit v1.2.1