From 2e1514095d1ebc4a75abcbeca6caf8713b0c0f5b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 22 Jan 2026 02:33:42 +0000 Subject: [PATCH] fix: package Textual resources for mac app --- CHANGELOG.md | 1 + scripts/package-mac-app.sh | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa3ef3efe..52b4fe724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Docs: https://docs.clawd.bot ### Fixes - Doctor: warn when gateway.mode is unset with configure/config guidance. +- macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362) - UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai. ## 2026.1.21 diff --git a/scripts/package-mac-app.sh b/scripts/package-mac-app.sh index f0cc385b3..48622efe1 100755 --- a/scripts/package-mac-app.sh +++ b/scripts/package-mac-app.sh @@ -227,15 +227,29 @@ fi echo "📦 Copying Textual resources" TEXTUAL_BUNDLE_DIR="$(build_path_for_arch "$PRIMARY_ARCH")/$BUILD_CONFIG" -TEXTUAL_BUNDLE="$TEXTUAL_BUNDLE_DIR/textual_Textual.bundle" -if [ ! -d "$TEXTUAL_BUNDLE" ]; then - TEXTUAL_BUNDLE="$TEXTUAL_BUNDLE_DIR/Textual_Textual.bundle" +TEXTUAL_BUNDLE="" +for candidate in \ + "$TEXTUAL_BUNDLE_DIR/textual_Textual.bundle" \ + "$TEXTUAL_BUNDLE_DIR/Textual_Textual.bundle" +do + if [ -d "$candidate" ]; then + TEXTUAL_BUNDLE="$candidate" + break + fi +done +if [ -z "$TEXTUAL_BUNDLE" ]; then + TEXTUAL_BUNDLE="$(find "$BUILD_ROOT" -type d \( -name "textual_Textual.bundle" -o -name "Textual_Textual.bundle" \) -print -quit)" fi -if [ -d "$TEXTUAL_BUNDLE" ]; then +if [ -n "$TEXTUAL_BUNDLE" ] && [ -d "$TEXTUAL_BUNDLE" ]; then rm -rf "$APP_ROOT/Contents/Resources/$(basename "$TEXTUAL_BUNDLE")" cp -R "$TEXTUAL_BUNDLE" "$APP_ROOT/Contents/Resources/" else - echo "WARN: Textual resource bundle not found in $TEXTUAL_BUNDLE_DIR (continuing)" >&2 + if [[ "${ALLOW_MISSING_TEXTUAL_BUNDLE:-0}" == "1" ]]; then + echo "WARN: Textual resource bundle not found (continuing due to ALLOW_MISSING_TEXTUAL_BUNDLE=1)" >&2 + else + echo "ERROR: Textual resource bundle not found. Set ALLOW_MISSING_TEXTUAL_BUNDLE=1 to bypass." >&2 + exit 1 + fi fi echo "⏹ Stopping any running Clawdbot"