No LibreOffice in Open With: built bundle claims nothing, no image is mounted (R2.15)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 01:23:06 -04:00
1 parent 5a36ffc272
commit 466afe20a0
8 files changed
+80 -52

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# The built LibreOffice bundle holds libraries, nothing to register.
set -euo pipefail
app=${1:?usage: scripts/inert-lo.sh path/to/LibreOffice.app}
plist=$app/Contents/Info.plist
[ -f "$plist" ] || { echo "inert-lo.sh: no $plist" >&2; exit 1; }
lsregister=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
for key in CFBundleDocumentTypes CFBundleURLTypes UTExportedTypeDeclarations UTImportedTypeDeclarations; do
if /usr/libexec/PlistBuddy -c "Print :$key" "$plist" >/dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Delete :$key" "$plist"
fi
done
rm -rf "$app/Contents/PlugIns" "$app/Contents/Library/Spotlight"
"$lsregister" -u "$app"
# Spotlight would find the bundle and register it again.
touch "$(cd "$app/../../.." && pwd)/.metadata_never_index"
echo "inert-lo.sh: $app claims no files and is unregistered"