rss-reader/justfile

49 lines
1.2 KiB
Makefile
Raw Normal View History

2025-02-03 16:32:50 -08:00
_default:
@just --list
2025-02-04 01:42:46 -08:00
# Don't use this secret key for your own install, it's public!
2025-02-03 21:04:08 -08:00
export SECRET_KEY := "MHSePvm1msyOkYuJ7u+MtyJYCzgdHCS7QNvrk9ts+rI="
2025-02-17 02:03:44 -08:00
# 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
2025-02-04 22:21:40 -08:00
[doc("Run the reader locally in demo mode.")]
2025-02-17 02:03:44 -08:00
run-local-demo *args: frontend-build
2025-02-04 01:29:25 -08:00
cargo run -- --demo {{args}}
2025-02-03 16:32:50 -08:00
2025-02-04 22:21:40 -08:00
# Run the reader locally against a persistent sqlite database
2025-02-17 02:03:44 -08:00
run-local-persistant-db *args: frontend-build
2025-02-04 22:21:40 -08:00
cargo run -- --database data.sqlite
2025-02-17 02:54:55 -08:00
# Run the reader locally from the nix flake
run-local-nix:
nix run '.#default' -- --database data.sqlite
2025-02-17 02:03:44 -08:00
# 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'
2025-02-03 16:32:50 -08:00
sqlx-prepare:
2025-02-05 02:01:06 -08:00
#!/usr/bin/env sh
if [ ! -f "data.sqlite" ]; then
touch data.sqlite
fi
DATABASE_URL="sqlite:data.sqlite" cargo sqlx migrate run
2025-02-03 16:32:50 -08:00
DATABASE_URL="sqlite:data.sqlite" cargo sqlx prepare