Skip to content

Commit f38edfa

Browse files
committed
fix(scripts): guard empty arrays under set -u; opt sample-service vats into crypto
1 parent 0f90bbe commit f38edfa

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/sample-services/scripts/reset-services.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ rm -f "$SERVICES_HOME/daemon.log"
8686
# ---------------------------------------------------------------------------
8787

8888
info "Starting sample-services daemon..."
89-
"$START_SERVICES_SCRIPT" "$MATCHER_URL" "${PASSTHROUGH_ARGS[@]}" >&2
89+
"$START_SERVICES_SCRIPT" "$MATCHER_URL" ${PASSTHROUGH_ARGS[@]+"${PASSTHROUGH_ARGS[@]}"} >&2
9090

9191
cat <<EOF >&2
9292

packages/sample-services/scripts/start-services.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ launch_service() {
211211
vats: {
212212
[process.env.VAT_NAME]: {
213213
bundleSpec: process.env.BUNDLE,
214-
parameters: { matcherUrl: process.env.MATCHER_URL }
214+
parameters: { matcherUrl: process.env.MATCHER_URL },
215+
// Both services use crypto.getRandomValues for registration
216+
// tokens; RandomNumber also uses it for its draws.
217+
globals: ['crypto']
215218
}
216219
}
217220
}

packages/service-matcher/scripts/reset-everything.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ rm -f \
115115
# ---------------------------------------------------------------------------
116116

117117
info "Starting matcher..."
118-
MATCHER_URL="$("$SCRIPT_DIR/start-matcher.sh" "${START_MATCHER_ARGS[@]}")"
118+
MATCHER_URL="$("$SCRIPT_DIR/start-matcher.sh" ${START_MATCHER_ARGS[@]+"${START_MATCHER_ARGS[@]}"})"
119119
if [[ -z "$MATCHER_URL" ]]; then
120120
echo "[reset] ERROR: start-matcher.sh produced no URL." >&2
121121
exit 1

0 commit comments

Comments
 (0)