add root cp
This commit is contained in:
@ -14,6 +14,10 @@ $$ echo "a shell command"
|
|||||||
# copying files
|
# copying files
|
||||||
filea -> fileb
|
filea -> fileb
|
||||||
|
|
||||||
|
# the copy command may also be prefixed with a # like so:
|
||||||
|
filea #-> fileb
|
||||||
|
# which will copy the file as root
|
||||||
|
|
||||||
# installing programs
|
# installing programs
|
||||||
:: neovim,firefox,neofetch
|
:: neovim,firefox,neofetch
|
||||||
```
|
```
|
||||||
|
13
auto.
13
auto.
@ -165,13 +165,18 @@ while read -r line || return 0; do
|
|||||||
# remove/add a file
|
# remove/add a file
|
||||||
elif printf "%s" "$line" | grep -q -- "->"; then
|
elif printf "%s" "$line" | grep -q -- "->"; then
|
||||||
# get the path of the file
|
# get the path of the file
|
||||||
sourcef=$(eval echo "${line%%\ ->*}")
|
sourcef=$(eval echo "${line%% *->*}")
|
||||||
|
|
||||||
# get the destination for the file
|
# get the destination for the file
|
||||||
destf=$(eval echo "${line##*->\ }")
|
destf=$(eval echo "${line##*->* }")
|
||||||
|
|
||||||
# install/uninstall
|
# install/uninstall
|
||||||
[ $install ] && cp -rv -- "$sourcef" "$destf"
|
if printf "%s" "$line" | grep -q -- "#->"; then
|
||||||
[ $uninstall ] && rm -rv -- "$destf"
|
[ $install ] && dort cp -rv -- "$sourcef" "$destf"
|
||||||
|
[ $uninstall ] && dort rm -rv -- "$destf"
|
||||||
|
else
|
||||||
|
[ $install ] && cp -rv -- "$sourcef" "$destf"
|
||||||
|
[ $uninstall ] && rm -rv -- "$destf"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$topography"
|
done < "$topography"
|
||||||
|
Reference in New Issue
Block a user