1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 16:10:08 +00:00

refactor(optimize): use shared get_lsregister_path from base.sh

Remove duplicate get_lsregister_path() implementation and use the
shared utility from base.sh instead.
This commit is contained in:
tw93
2026-02-26 11:53:44 +08:00
parent 88b0fe6af3
commit d0e1a200d6

View File

@@ -406,18 +406,8 @@ opt_launch_services_rebuild() {
start_inline_spinner ""
fi
local lsregister=""
local -a lsregister_candidates=(
"/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
"/System/Library/CoreServices/Frameworks/LaunchServices.framework/Support/lsregister"
)
local lsregister_candidate=""
for lsregister_candidate in "${lsregister_candidates[@]}"; do
if [[ -x "$lsregister_candidate" ]]; then
lsregister="$lsregister_candidate"
break
fi
done
local lsregister
lsregister=$(get_lsregister_path)
if [[ -n "$lsregister" ]]; then
local success=0