| 1 | #!/usr/bin/env bash |
| 2 | # Single-executable entry for scripts/desktop-shell-metrics.sh: exec the |
| 3 | # Electron binary so the measured pid is the shell itself. |
| 4 | set -euo pipefail |
| 5 | root="$(cd "$(dirname "$0")/.." && pwd)" |
| 6 | service="${REASONIX_DESKTOP_SERVICE:-$root/../build/bin/reasonix-desktop-service}" |
| 7 | electron="$(node -e 'process.stdout.write(require("electron"))' 2>/dev/null || true)" |
| 8 | if [ -z "$electron" ]; then electron="$(cd "$root" && node -e 'process.stdout.write(require("electron"))')"; fi |
| 9 | export REASONIX_DESKTOP_SERVICE="$service" |
| 10 | exec "$electron" "$root" |
| 11 |