add linking
This commit is contained in:
@ -18,6 +18,12 @@ filea -> fileb
|
|||||||
filea #-> fileb
|
filea #-> fileb
|
||||||
# which will copy the file as root
|
# which will copy the file as root
|
||||||
|
|
||||||
|
# symbolically linking files
|
||||||
|
filea ~> fileb
|
||||||
|
|
||||||
|
# the link command may be prefixed just like the copy command
|
||||||
|
filea #~> fileb
|
||||||
|
|
||||||
# installing programs
|
# installing programs
|
||||||
:: neovim,firefox,neofetch
|
:: neovim,firefox,neofetch
|
||||||
```
|
```
|
||||||
|
17
auto.
17
auto.
@ -178,5 +178,22 @@ while read -r line || return 0; do
|
|||||||
[ $install ] && cp -rv -- "$sourcef" "$destf"
|
[ $install ] && cp -rv -- "$sourcef" "$destf"
|
||||||
[ $uninstall ] && rm -rv -- "$destf"
|
[ $uninstall ] && rm -rv -- "$destf"
|
||||||
fi
|
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
|
fi
|
||||||
done < "$topography"
|
done < "$topography"
|
||||||
|
Reference in New Issue
Block a user