aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: f8f3413969a46077240c52dd50dc10a5ceed424a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DB := "fun.db"

setup: reset-db

run file *args:
  sqlite3 "{{DB}}" {{args}} < "{{file}}"

image file *args:
  #!/usr/bin/env sh
  set -eu
  image_id=$(just run "{{file}}" {{args}})
  just show-image "$image_id"

show-image image_id:
  echo "Displaying {{image_id}}" 1>&2
  ./image.sh {{image_id}} | tee output.ignore.txt | magick display ppm:-

repl *args:
  rlwrap sqlite3 "{{DB}}" {{args}}

reset-db:
  rm "{{DB}}"
  sqlite3 "{{DB}}" < setup.sql