diff options
author | Squibid <me@zacharyscheiman.com> | 2024-08-10 02:41:22 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-08-10 02:41:22 -0400 |
commit | f1c4d798251a5bac90ccd289da1dec7839beafe8 (patch) | |
tree | 879d44ab00824138a0efb4ec899d6c76e778bfcd /auto. | |
parent | 46c1a319051ec87fe3cb8f14000e62e050abdab3 (diff) | |
download | auto.s-f1c4d798251a5bac90ccd289da1dec7839beafe8.tar.gz auto.s-f1c4d798251a5bac90ccd289da1dec7839beafe8.tar.bz2 auto.s-f1c4d798251a5bac90ccd289da1dec7839beafe8.zip |
add linking
Diffstat (limited to 'auto.')
-rwxr-xr-x | auto. | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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" |