17 lines
991 B
Bash
Executable File
17 lines
991 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# `pnpm assets:upload [--check] <seed folder>`: uploads the SVG drawings of a generated sheet
|
|
# seed folder to the private bucket `anatomical-sheet-assets` of the LOCAL Supabase stack
|
|
# (R5.5, docs/development/SUPABASE.md §3.1). The `upload-sheet-assets` binary of crates/core
|
|
# behind its `upload` feature, on the native toolchain (scripts/rust-env.sh); the first run
|
|
# compiles it (release profile). Reads SUPABASE_URL (a local address, no default) and
|
|
# SUPABASE_SERVICE_ROLE_KEY from the environment; a relative folder is typed from the folder
|
|
# pnpm was run in (INIT_CWD). Run it by hand: the service key is typed, never stored.
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
. scripts/rust-env.sh
|
|
|
|
# Compile without the key in the environment (build scripts never see it), then run the binary.
|
|
env -u SUPABASE_SERVICE_ROLE_KEY cargo build --release --locked -q -p faunosteo-core --features upload --bin upload-sheet-assets
|
|
exec target/release/upload-sheet-assets "$@"
|