mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 20:15:07 +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:
@@ -406,18 +406,8 @@ opt_launch_services_rebuild() {
|
|||||||
start_inline_spinner ""
|
start_inline_spinner ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local lsregister=""
|
local lsregister
|
||||||
local -a lsregister_candidates=(
|
lsregister=$(get_lsregister_path)
|
||||||
"/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
|
|
||||||
|
|
||||||
if [[ -n "$lsregister" ]]; then
|
if [[ -n "$lsregister" ]]; then
|
||||||
local success=0
|
local success=0
|
||||||
|
|||||||
Reference in New Issue
Block a user