fix nix code
This commit is contained in:
16
lib.nix
16
lib.nix
@@ -108,13 +108,15 @@ in
|
||||
)
|
||||
);
|
||||
};
|
||||
setupInitialDatabases = if initialDatabases != [] then (
|
||||
lib.concatMapStrings (db: ''
|
||||
echo "Checking presence of database ${db.name}"
|
||||
dbAlreadyExists="$(echo "SELECT 1 AS result FROM pg_database WHERE datname='${db.name}';" | psql --dbname postgres | ${pkgs.gnugrep}/bin/grep -c 'exists = "1"' || true)"
|
||||
echo $dbAlreadyExists
|
||||
'') initialDatabases
|
||||
);
|
||||
setupInitialDatabases =
|
||||
if initialDatabases != [ ] then
|
||||
(lib.concatMapStrings (db: ''
|
||||
echo "Checking presence of database ${db.name}"
|
||||
dbAlreadyExists="$(echo "SELECT 1 AS result FROM pg_database WHERE datname='${db.name}';" | psql --dbname postgres | ${pkgs.gnugrep}/bin/grep -c 'exists = "1"' || true)"
|
||||
echo $dbAlreadyExists
|
||||
'') initialDatabases)
|
||||
else
|
||||
"";
|
||||
setupScript = pkgs.writeShellApplication {
|
||||
name = "setup-postgres";
|
||||
runtimeInputs = [
|
||||
|
||||
Reference in New Issue
Block a user