roamwright 0.61.24 → 0.61.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tools/ios-sim.sh CHANGED
@@ -15,6 +15,7 @@
15
15
  # SIM_DEVICE simulator device name (default: "iPhone 14 Pro Max")
16
16
  # SIM_CHROME_BUNDLE Chromium iOS bundle id (default: org.chromium.ost.chrome.ios.dev)
17
17
  # SIM_PORT localhost port for the simulator server (default: 8764)
18
+ # SIM_ARRIVE seconds to wait for the browser to ask for the page (default: 30)
18
19
  # SIM_STORAGE_LOG_KEY localStorage key holding the diagnostic log JSON (default: roamwright:log)
19
20
  # SIM_DEFAULT_ADDRESS default route address when $1 is omitted
20
21
  # SIM_SERVE_SCRIPT relative path to server script supporting SERVE_ENTRY (default: scripts/serve.py)
@@ -84,12 +85,15 @@ xcrun simctl terminate "$udid" "$CHROME" 2>/dev/null || true
84
85
  began=$(date -u +%Y-%m-%dT%H:%M:%S)
85
86
  xcrun simctl launch "$udid" "$CHROME" >/dev/null
86
87
  arrived=
87
- for _ in 1 2 3 4 5 6 7 8 9 10 11 12; do
88
+ # A busy Mac (a gate's sweeps running beside it) can take well over 12 s to restore the browser's tab: wait SIM_ARRIVE seconds.
89
+ waited_for=0
90
+ while [ "$waited_for" -lt "${SIM_ARRIVE:-30}" ]; do
88
91
  grep -q "GET /?$entry " "$asked" && {
89
92
  arrived=1
90
93
  break
91
94
  }
92
95
  sleep 1
96
+ waited_for=$((waited_for + 1))
93
97
  done
94
98
  [ -n "$arrived" ] || {
95
99
  xcrun simctl openurl "$udid" "chromium://localhost:$port/" >/dev/null 2>&1 || true