Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
# to an "agent" pane. CONFIG (JSON settings) and ARGS pass to rexdiff.
set -e
BIN=/tmp/rexdiff-dev/rexdiff
cd "$(dirname "$0")" && go build -o $BIN ./cmd/rexdiff
cd "$(dirname "$0")"
S=rexreview-test; R=${REXDIFF_DEMO:-$PWD}
if ! git -C "$R" rev-parse --show-toplevel >/dev/null 2>&1; then
echo "dev.sh: not a Git working tree: $R (set REXDIFF_DEMO to a repository)" >&2
exit 1
fi
go build -o "$BIN" ./cmd/rexdiff
export PATH="${REX_BIN_DIR:+$REX_BIN_DIR:}$PATH"
S=rexreview-test; R=${REXDIFF_DEMO:-/tmp/rexreview-demo}
has() { rex block inspect "$1" -s $S --json >/dev/null 2>&1; }
rex ls | grep -q "^$S " || rex new $S --cwd $R -- fish >/dev/null
has agent || { rex run -s $S --label agent --cwd $R -- fish >/dev/null; sleep 1; }
rex ls | grep -q "^$S " || rex new $S --cwd "$R" -- "${SHELL:-/bin/sh}" >/dev/null
has agent || { rex run -s $S --label agent --cwd "$R" -- "${SHELL:-/bin/sh}" >/dev/null; sleep 1; }
for id in $(rex api call -s $S session.list_blocks '{}' | python3 -c 'import json,sys;[print(b["block_id"]) for b in json.load(sys.stdin)["blocks"] if b.get("label")=="rexdiff"]'); do
rex api call -s $S block.close "{\"block_id\":\"$id\"}" >/dev/null 2>&1 || true
done
sleep 0.5
rex split -s $S -b agent --label rexdiff --ratio 70 --cwd $R -- $BIN -config "${CONFIG:-}" -log /tmp/rexdiff.log --agent agent $ARGS >/dev/null
rex split -s $S -b agent --label rexdiff --ratio 70 --cwd "$R" -- "$BIN" -config "${CONFIG:-}" -log /tmp/rexdiff.log --agent agent $ARGS >/dev/null
sleep 0.5
rex block call -s $S -b rexdiff resize "{\"columns\":${COLS:-170},\"rows\":${ROWS:-30}}" >/dev/null
sleep 1.5
Expand Down