nix: move withtmpdb to separate file
Co-authored-by: Remo Rechkemmer <59358383+monacoremo@users.noreply.github.com>
This commit is contained in:
committed by
Wolfgang Walther
co-authored by
Remo Rechkemmer
parent
f99fd6cbad
commit
579a626de2
@@ -0,0 +1,20 @@
|
||||
# Wrap the `test/with_tmp_db` script with the required dependencies from Nix.
|
||||
{ checkedShellScript }:
|
||||
|
||||
postgresql:
|
||||
checkedShellScript
|
||||
{
|
||||
name = "postgrest-test-withtmpdb-${postgresql.name}";
|
||||
docs = "Run the given command in a temporary database";
|
||||
inRootDir = true;
|
||||
}
|
||||
''
|
||||
# avoid starting multiple layers of with_tmp_db
|
||||
if test ! -v PGRST_DB_URI; then
|
||||
export PATH=${postgresql}/bin:"$PATH"
|
||||
|
||||
exec test/with_tmp_db "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
''
|
||||
Reference in New Issue
Block a user