3# Helper script to quickly try different error examples
6 echo "Usage: ./try-error.sh <example-number>"
8 echo "Available examples:"
9 echo " 1 - Missing config entirely"
10 echo " 2 - Partial context (have logger, missing database)"
11 echo " 3 - Multiple missing dependencies"
12 echo " 4 - Success case (all dependencies provided)"
14 echo "Example: ./try-error.sh 1"
18PLAYGROUND="test/Playground.purs"
20# Comment out all examples first
21sed -i.bak 's/^example/-- example/g' "$PLAYGROUND"
22sed -i.bak 's/^combined/-- combined/g' "$PLAYGROUND"
26 echo "๐ Trying Example 1: Missing config entirely"
27 sed -i.bak 's/^-- example1/example1/g' "$PLAYGROUND"
30 echo "๐ Trying Example 2: Partial context"
31 sed -i.bak 's/^-- example2/example2/g' "$PLAYGROUND"
34 echo "๐ Trying Example 3: Multiple missing dependencies"
35 sed -i.bak 's/^-- combined/combined/g' "$PLAYGROUND"
36 sed -i.bak 's/^-- example3/example3/g' "$PLAYGROUND"
39 echo "โ
Trying Example 4: Success case"
40 sed -i.bak 's/^-- example4/example4/g' "$PLAYGROUND"
43 echo "Invalid example number. Use 1, 2, 3, or 4"
49cd /Users/mark/Developer/purescript-yoga-om
50npx spago build -p yoga-om-layer 2>&1 | grep -A 30 "Custom error\|Build succeeded" | head -35
53mv "$PLAYGROUND.bak" "$PLAYGROUND" 2>/dev/null
57echo "To try another example, run: ./try-error.sh <number>"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list