Skip to content

Commit 6eadbc9

Browse files
authored
Merge pull request #8 from trouze/feat/demo-enter-key
demo: advance on Enter key instead of fixed PAUSE
2 parents d5a5b00 + e7c6af2 commit 6eadbc9

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ An end-to-end walkthrough you can record or run locally:
147147
./scripts/demo.sh
148148
```
149149

150-
Drives every subcommand (`analyze`, `analyze --show-path`, `replay`, `replay --warehouse-size L/XL`, `--credits-per-hour` for non-Snowflake, JSON + `jq`) against a synthetic 24-model baseball-analytics DAG in `tests/fixtures/demo_project/`. Set `PAUSE=0` to dry-run without narration beats.
150+
Drives every subcommand (`analyze`, `analyze --show-path`, `replay`, `replay --warehouse-size L/XL`, `--credits-per-hour` for non-Snowflake, JSON + `jq`) against a synthetic 24-model baseball-analytics DAG in `tests/fixtures/demo_project/`. Press **Enter** to advance each step. Set `AUTO=1 PAUSE=0` for a hands-free dry-run.
151151

152152
## Development
153153

scripts/demo.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
# shared bottleneck (int_game_events) sitting on three of the top longest paths.
77
#
88
# Usage:
9-
# ./scripts/demo.sh
10-
#
11-
# Each command is echoed in bold before it runs, with a narration hint above.
12-
# Pause between commands by setting PAUSE=2 (default) or call with PAUSE=0 to
13-
# rush through for a dry-run.
9+
# ./scripts/demo.sh # interactive: Enter advances each step
10+
# AUTO=1 PAUSE=2 ./scripts/demo.sh # non-interactive: 2s sleep per step
11+
# AUTO=1 PAUSE=0 ./scripts/demo.sh # rapid dry-run (CI smoke)
1412

1513
set -euo pipefail
1614

17-
PAUSE="${PAUSE:-2}"
15+
AUTO="${AUTO:-0}"
16+
PAUSE="${PAUSE:-0.5}"
1817
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1918
MANIFEST="$ROOT/tests/fixtures/demo_project/manifest.json"
2019
RUN_RESULTS="$ROOT/tests/fixtures/demo_project/run_results.json"
@@ -26,12 +25,21 @@ section() {
2625
printf "\033[1;36m▌ %s\033[0m\n" "$*"
2726
echo
2827
}
28+
wait_step() {
29+
if [ "$AUTO" = "1" ]; then
30+
sleep "$PAUSE"
31+
return
32+
fi
33+
# Dim hint, then clear the line after Enter so the recording stays clean.
34+
printf "\033[2m ↵ \033[0m"
35+
read -r _
36+
printf "\033[1A\033[2K"
37+
}
2938
run() {
3039
bold "\$ $*"
31-
sleep "$PAUSE"
40+
wait_step
3241
eval "$@"
3342
echo
34-
sleep "$PAUSE"
3543
}
3644

3745
section "1 · Which paths through the DAG are actually slow?"

0 commit comments

Comments
 (0)