49 lines
1.2 KiB
Makefile
49 lines
1.2 KiB
Makefile
_default:
|
|
@just --list
|
|
|
|
# Don't use this secret key for your own install, it's public!
|
|
export SECRET_KEY := "MHSePvm1msyOkYuJ7u+MtyJYCzgdHCS7QNvrk9ts+rI="
|
|
|
|
# Install frontend dependencies
|
|
frontend-install:
|
|
cd static && npm install
|
|
|
|
# Build frontend assets
|
|
frontend-build: frontend-install
|
|
#!/usr/bin/env sh
|
|
mkdir -p static/dist
|
|
rm -rf static/dist/*
|
|
cd static && npm run build
|
|
|
|
# Watch frontend assets during development
|
|
frontend-watch:
|
|
cd static && npm run dev
|
|
|
|
[doc("Run the reader locally in demo mode.")]
|
|
run-local-demo *args: frontend-build
|
|
cargo run -- --demo {{args}}
|
|
|
|
# Run the reader locally against a persistent sqlite database
|
|
run-local-persistant-db *args: frontend-build
|
|
cargo run -- --database data.sqlite
|
|
|
|
# Run the reader locally from the nix flake
|
|
run-local-nix:
|
|
nix run '.#default' -- --database data.sqlite
|
|
|
|
# Run the reader in development mode with frontend asset watching
|
|
dev:
|
|
#!/usr/bin/env sh
|
|
just frontend-install
|
|
(just frontend-watch &)
|
|
cargo watch -x 'run -- --demo'
|
|
|
|
sqlx-prepare:
|
|
#!/usr/bin/env sh
|
|
if [ ! -f "data.sqlite" ]; then
|
|
touch data.sqlite
|
|
fi
|
|
DATABASE_URL="sqlite:data.sqlite" cargo sqlx migrate run
|
|
DATABASE_URL="sqlite:data.sqlite" cargo sqlx prepare
|
|
|