Files
openclaw/scripts/format-swift.sh
Vincent Koc 96b1be10f5 feat(macos): keep MLX TTS model resident (#104200)
* test(macos): cover MLX helper packaging

* feat(macos): define framed MLX TTS protocol

* feat(macos): keep MLX TTS model resident

* feat(macos): reuse MLX TTS helper transport

* fix(macos): preserve MLX TTS fallback lifecycle

* chore(swift): lint MLX TTS protocol sources

* fix(macos): keep MLX helper input nonblocking

* test(macos): cover forced MLX helper shutdown

* fix(macos): fall back after MLX memory eviction

* fix(macos): discard canceled MLX audio
2026-07-11 13:45:27 +08:00

39 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "$0")/.." && pwd)"
cd "$repo_root"
scope="${1:-all}"
if [[ "$scope" != "all" && "$scope" != "ios" && "$scope" != "macos" ]]; then
echo "usage: $0 [ios|macos]" >&2
exit 2
fi
./scripts/check-swift-tools.sh swiftformat
if [[ "$scope" != "ios" ]]; then
swiftformat --lint apps/macos/Sources \
--config config/swiftformat \
--exclude '**/OpenClawProtocol'
swiftformat --lint \
apps/macos-mlx-tts/Sources \
apps/shared/OpenClawMLXTTSProtocol/Sources \
apps/swabble/Sources \
--config config/swiftformat
fi
if [[ "$scope" == "macos" ]]; then
exit 0
fi
node scripts/ios-write-swift-filelist.mjs
(
cd apps/ios
swiftformat --lint \
--config ../../config/swiftformat \
--unexclude "$PWD/Sources,$PWD/ShareExtension,$PWD/ActivityWidget,$PWD/WatchApp,$PWD/../shared/OpenClawKit/Sources/OpenClawChatUI,$PWD/../shared/OpenClawKit/Sources/OpenClawKit,$PWD/../shared/OpenClawKit/Sources/OpenClawProtocol,$PWD/../swabble/Sources/SwabbleKit" \
--filelist SwiftSources.input.xcfilelist
)