macOS Tweaks

- handle changes with unzip binary in macOS 15.4
- handle cases where multiple xattr binaries are installed
This commit is contained in:
jetfir3
2025-03-04 14:34:30 -05:00
committed by GitHub
parent 176fc61d6d
commit 07f04cb32d

View File

@@ -605,6 +605,7 @@ xpui_detect() {
}
xpui_open() {
mkdir -p "${xpuiDir}"
unzip -qq "${xpuiSpa}" -d "${xpuiDir}"
[[ "${versionFailed}" && -z "${forceVer+x}" || -z "${forceVer+x}" && "${debug}" && "${devMode}" && "${t}" ]] && {
clientVer=$(perl -ne '/[Vv]ersion[:=,\x22]{1,3}(1\.[0-9]+\.[0-9]+\.[0-9]+)\.g[0-9a-f]+/ && print "$1"' "${xpuiJs}")
@@ -697,8 +698,8 @@ run_finish() {
(cd "${xpuiDir}" || exit; zip -qq -r ../xpui.spa .)
rm -rf "${xpuiDir}"
[[ "${platformType}" == "macOS" ]] && {
[[ "${skipCodesign}" ]] && xattr -cr "${appPath}" 2>/dev/null || {
xattr -cr "${appPath}" 2>/dev/null
[[ "${skipCodesign}" ]] && /usr/bin/xattr -cr "${appPath}" 2>/dev/null || {
/usr/bin/xattr -cr "${appPath}" 2>/dev/null
codesign -f --deep -s - "${appPath}" 2>/dev/null
printf "\xE2\x9C\x94\x20\x43\x6F\x64\x65\x73\x69\x67\x6E\x65\x64\x20\x53\x70\x6F\x74\x69\x66\x79\n"
}