From c276e9741efdd2ac38b1136a91e9649798c22466 Mon Sep 17 00:00:00 2001 From: Laurence Isla Date: Fri, 1 Mar 2024 22:01:29 -0500 Subject: [PATCH] nix: fix postgrest-dump-schema with optional yaml output --- nix/tools/tests.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nix/tools/tests.nix b/nix/tools/tests.nix index 4606b1670..224e46c4e 100644 --- a/nix/tools/tests.nix +++ b/nix/tools/tests.nix @@ -91,16 +91,19 @@ let checkedShellScript { name = "postgrest-dump-schema"; - docs = "Dump the loaded schema's SchemaCache as a yaml file."; + docs = "Dump the loaded schema's SchemaCache in JSON or Yaml format."; + args = [ + "ARG_OPTIONAL_BOOLEAN([yaml], [y], [Dump the schema cache in Yaml format])" + ]; workingDir = "/"; withEnv = postgrest.env; withPath = [ jq ]; } '' - ${withTools.withPg} -f test/spec/fixtures.sql \ + ${withTools.withPg} -f test/spec/fixtures/load.sql \ ${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \ postgrest --dump-schema \ - | ${yq}/bin/yq -y . + | if [ "$_arg_yaml" = on ]; then ${yq}/bin/yq -y .; else cat; fi ''; coverage =