feat: supabase with env file reading

This commit is contained in:
2025-02-03 02:19:35 +00:00
parent f459c18b4c
commit f2307ff492
2 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "supabase" ''
# Get the root of the repository
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
# Source .env from root of the repo if it exists
if [ -f "$GIT_ROOT/.env" ]; then
set -a
. "$GIT_ROOT/.env"
set +a
fi
${pkgs.supabase-cli}/bin/supabase --workdir "$GIT_ROOT/web" $@
''