aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: 9eefddf400ba18fa4d0c727aaf943b2245d48f3b (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}}"

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

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