From cdc9d366cd116a8c2c70780c4b944e9e2d11e0f2 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 17:41:37 -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 f8babf47476a3607889aff36cfc047925b0bbfcd Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 17:43:09 -0400 Subject: [PATCH 2/2] build(source-os): exercise installed sourceos-office open path in shell smoke --- .../install_sourceos_office_shell_smoke.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 848f5d4..3bc4b3e 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh @@ -14,8 +14,11 @@ mkdir -p "$HOME" DESKTOP_FILE="$XDG_DATA_HOME/applications/sourceos-office.desktop" 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 @@ -27,6 +30,11 @@ MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" exit 1 } +[[ -x "$SOURCEOS_OFFICE_BIN" ]] || { + echo "office shell installer smoke failed: missing sourceos-office command" >&2 + exit 1 +} + [[ -x "$CLOUD_BIN" ]] || { echo "office shell installer smoke failed: missing cloud handoff helper" >&2 exit 1 @@ -37,4 +45,13 @@ MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" 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"