From f2444637e167b48202ca01ed195368a1f3f1ce7a Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 18:03:21 -0400 Subject: [PATCH 1/2] build(source-os): make installed sourceos-office resolve sibling helpers first --- build/office-suite/scripts/sourceos-office | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/build/office-suite/scripts/sourceos-office b/build/office-suite/scripts/sourceos-office index ea5251f..a53a154 100644 --- a/build/office-suite/scripts/sourceos-office +++ b/build/office-suite/scripts/sourceos-office @@ -1,22 +1,37 @@ #!/usr/bin/env bash set -euo pipefail -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" CMD="${1:-help}" shift || true +resolve_helper() { + local sibling="$1" + local repo_path="$2" + if [[ -x "$SCRIPT_DIR/$sibling" ]]; then + printf '%s\n' "$SCRIPT_DIR/$sibling" + return 0 + fi + if [[ -x "$ROOT/$repo_path" ]]; then + printf '%s\n' "$ROOT/$repo_path" + return 0 + fi + return 1 +} + case "$CMD" in install) - "$ROOT/build/office-suite/scripts/install_sourceos_office_shell.sh" + "$(resolve_helper install_sourceos_office_shell.sh build/office-suite/scripts/install_sourceos_office_shell.sh)" ;; verify) - "$ROOT/build/office-suite/scripts/office_shell_verify.sh" + "$(resolve_helper office_shell_verify.sh build/office-suite/scripts/office_shell_verify.sh)" ;; open) - "$ROOT/build/office-suite/scripts/office_open.sh" "$@" + "$(resolve_helper office_open.sh build/office-suite/scripts/office_open.sh)" "$@" ;; search) - "$ROOT/build/office-suite/scripts/office_search_open.sh" "$@" + "$(resolve_helper office_search_open.sh build/office-suite/scripts/office_search_open.sh)" "$@" ;; help|*) cat <<'EOF' From 3f666c060398b9e11b09056896b5b637f826519a Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 18:04:13 -0400 Subject: [PATCH 2/2] build(source-os): exercise installed sourceos-office open path in shell smoke --- .../install_sourceos_office_shell_smoke.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh index a956627..3bc4b3e 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh @@ -17,6 +17,8 @@ OPEN_BIN="$HOME/.local/bin/sourceos-office-open" SOURCEOS_OFFICE_BIN="$HOME/.local/bin/sourceos-office" CLOUD_BIN="$HOME/.local/bin/office_cloud_handoff.sh" MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" +TEST_DOC="$TMPDIR/demo.txt" +echo "SourceOS office shell smoke" > "$TEST_DOC" [[ -f "$DESKTOP_FILE" ]] || { echo "office shell installer smoke failed: missing desktop entry" >&2 @@ -43,10 +45,13 @@ MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" exit 1 } -OUT="$($SOURCEOS_OFFICE_BIN help)" -[[ "$OUT" == *"usage: sourceos-office"* ]] || { - echo "office shell installer smoke failed: sourceos-office help mismatch" >&2 - exit 1 -} +OUT="$(SOURCEOS_OFFICE_MODE=cloud "$SOURCEOS_OFFICE_BIN" open "$TEST_DOC")" +case "$OUT" in + http://*|https://*) ;; + *) + echo "office shell installer smoke failed: installed sourceos-office open path did not return URL" >&2 + exit 1 + ;; +esac echo "office shell installer smoke passed"