feat: supabase with env file reading
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
printprogress = pkgs.callPackage ./package/printprogress.nix {};
|
||||
colorize = pkgs.callPackage ./package/colorize.nix {};
|
||||
github.gh-tl = pkgs.callPackage ./package/github/gh-tl.nix {};
|
||||
supabase-with-env-collection = pkgs.callPackage ./package/supabase-with-env-collection.nix {};
|
||||
prettify-log = pkgs.callPackage ./package/prettify-log/default.nix {
|
||||
inherit (self.lib) cargoToml;
|
||||
nativeBuildInputs = [
|
||||
|
||||
14
package/supabase-with-env-collection.nix
Normal file
14
package/supabase-with-env-collection.nix
Normal 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" $@
|
||||
''
|
||||
Reference in New Issue
Block a user