aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: 763a6a14b8157abcc99e4a2612a5ced2cbfae58b (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 >(magick ppm:- "media/{{image_id}}.png") | magick display ppm:-

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

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