From fcedfddf00b3f994e4f4e40332ac7fc192c63244 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 5 Oct 2025 21:56:51 +0700 Subject: claude is gud --- vere/boot-fake-ship.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 vere/boot-fake-ship.sh (limited to 'vere/boot-fake-ship.sh') diff --git a/vere/boot-fake-ship.sh b/vere/boot-fake-ship.sh new file mode 100755 index 0000000..f9b6362 --- /dev/null +++ b/vere/boot-fake-ship.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeuo pipefail + +urbit_binary=$GITHUB_WORKSPACE/$URBIT_BINARY +brass_pill=$GITHUB_WORKSPACE/brass.pill + +curl -LJ -o $brass_pill https://github.com/urbit/urbit/raw/592b957a30b302cb7ae7fea78c6804c9d63d97ef/bin/brass.pill +curl -LJ -o urbit.tar.gz https://github.com/urbit/urbit/archive/592b957a30b302cb7ae7fea78c6804c9d63d97ef.tar.gz + +mkdir ./urbit +tar xfz urbit.tar.gz -C ./urbit --strip-components=1 +cp -RL ./urbit/tests ./urbit/pkg/arvo/tests + +$urbit_binary --lite-boot --daemon --fake bus \ + --bootstrap $brass_pill \ + --arvo ./urbit/pkg/arvo \ + --pier ./pier + +cleanup() { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi + set +x +} + +trap cleanup EXIT +port=$(grep loopback ./pier/.http.ports | awk -F ' ' '{print $1}') + +lensd() { + curl -s \ + --data "{\"source\":{\"dojo\":\"$1\"},\"sink\":{\"stdout\":null}}" \ + "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g' +} + +lensa() { + curl -s \ + --data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \ + "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g' +} + +check() { + [ 3 -eq $(lensd 3) ] +} + +lensd '+vat %base' + +if check && sleep 10 && check; then + echo "boot success" + lensa hood '+hood/exit' + while [ -f ./pier/.vere.lock ]; do + echo "waiting for pier to shut down" + sleep 5 + done +else + echo "boot failure" + kill $(< ./pier/.vere.lock) || true + set +x + exit 1 +fi -- cgit v1.2.3