#!/bin/bash # Round01 real screenshot sample probe. This is a diagnostic entrypoint and # must not be treated as a product UI. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" OUTPUT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" # shellcheck source=build-output-paths.sh source "$SCRIPT_DIR/build-output-paths.sh" SOURCE_ROOT="$OUTPUT_ROOT/C1.source" APP="$BUILD_CURRENT_APP" SAMPLE_DIR="$BUILD_REPORT_ROOT/round01-screenshot-samples" SAMPLE_DOCUMENT="$SAMPLE_DIR/document-sample.txt" prepare_sample_windows() { mkdir -p "$SAMPLE_DIR" printf 'Aligner Round01 screenshot probe document sample.\n' > "$SAMPLE_DOCUMENT" open "$HOME" >/dev/null 2>&1 || true open -a Safari about:blank >/dev/null 2>&1 || true open -a Terminal >/dev/null 2>&1 || true open -a TextEdit "$SAMPLE_DOCUMENT" >/dev/null 2>&1 || true open -b com.apple.systempreferences >/dev/null 2>&1 || open -a "System Settings" >/dev/null 2>&1 || true sleep "${ALIGNER_SCREENSHOT_PROBE_PREPARE_DELAY:-2}" } if [[ "${ALIGNER_SKIP_SCREENSHOT_PROBE_PREPARE:-0}" != "1" ]]; then prepare_sample_windows fi cd "$SOURCE_ROOT" swift build >&2 "$SCRIPT_DIR/package-app.sh" >&2 "$APP/Contents/MacOS/Aligner" \ --round0-skip-permissions \ --round01-screenshot-probe \ --round01-screenshot-probe-pretty