[DO NOT UPDATE] Fix unlink() method once again

This commit is contained in:
JeremyStar™ 2024-06-02 22:03:40 +02:00
parent d2cd0e348f
commit ecfa7c856b
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -1,9 +1,11 @@
#!/bin/bash
# jeremystartm's dotfiles "installer"
FORCED_UNLINKING=
# utility function
function unlink() {
if [ -a "${HOME}/${*}" ]; then
if [ -a "${HOME}/${*}" ] || [ -n "${FORCED_UNLINKING}" ]; then
echo ":: Unlinking ${1}"
rm -rf "${HOME:?}/${*:?}"
fi
@ -72,9 +74,11 @@ for arg in "${@}"; do
)
for path in "${legacypaths[@]}"; do
unlink "${path}"
FORCED_UNLINKING=y unlink "${path}"
done
rm -rf "jstmbash" "dracula-mc"
echo ":: Unlinked legacy paths"
exit 1
;;