Keep settings files when cleaning. My bad that actually got removed in the first place.

This commit is contained in:
Storm Dragon
2025-08-02 03:59:52 -04:00
parent dfe51aa45f
commit 3679609923

View File

@ -57,8 +57,28 @@ uninstall_local() {
# Remove Python modules
rm -rf "${LOCAL_PREFIX}/lib/python"*/site-packages/cthulhu*
# Remove data files
rm -rf "${LOCAL_PREFIX}/share/cthulhu"
# Remove data files but preserve user settings
if [[ -d "${LOCAL_PREFIX}/share/cthulhu" ]]; then
# Backup user settings if they exist
if [[ -f "${LOCAL_PREFIX}/share/cthulhu/user-settings.conf" ]]; then
cp "${LOCAL_PREFIX}/share/cthulhu/user-settings.conf" /tmp/cthulhu-user-settings.backup
fi
if [[ -f "${LOCAL_PREFIX}/share/cthulhu/cthulhu-customizations.py" ]]; then
cp "${LOCAL_PREFIX}/share/cthulhu/cthulhu-customizations.py" /tmp/cthulhu-customizations.backup
fi
# Remove the directory
rm -rf "${LOCAL_PREFIX}/share/cthulhu"
# Recreate directory and restore user files
mkdir -p "${LOCAL_PREFIX}/share/cthulhu"
if [[ -f /tmp/cthulhu-user-settings.backup ]]; then
mv /tmp/cthulhu-user-settings.backup "${LOCAL_PREFIX}/share/cthulhu/user-settings.conf"
fi
if [[ -f /tmp/cthulhu-customizations.backup ]]; then
mv /tmp/cthulhu-customizations.backup "${LOCAL_PREFIX}/share/cthulhu/cthulhu-customizations.py"
fi
fi
# Remove docs
rm -rf "${LOCAL_PREFIX}/share/help/*/cthulhu"