add root cp

This commit is contained in:
2024-08-10 02:40:04 -04:00
parent cec832f43f
commit 46c1a31905
2 changed files with 13 additions and 4 deletions

13
auto.
View File

@ -165,13 +165,18 @@ while read -r line || return 0; do
# remove/add a file
elif printf "%s" "$line" | grep -q -- "->"; then
# get the path of the file
sourcef=$(eval echo "${line%%\ ->*}")
sourcef=$(eval echo "${line%% *->*}")
# get the destination for the file
destf=$(eval echo "${line##*->\ }")
destf=$(eval echo "${line##*->* }")
# install/uninstall
[ $install ] && cp -rv -- "$sourcef" "$destf"
[ $uninstall ] && rm -rv -- "$destf"
if printf "%s" "$line" | grep -q -- "#->"; then
[ $install ] && dort cp -rv -- "$sourcef" "$destf"
[ $uninstall ] && dort rm -rv -- "$destf"
else
[ $install ] && cp -rv -- "$sourcef" "$destf"
[ $uninstall ] && rm -rv -- "$destf"
fi
fi
done < "$topography"