nix: show better error messages for missing arguments in hsie scripts (#1798)

This commit is contained in:
Wolfgang Walther
2021-04-09 18:48:00 +02:00
committed by GitHub
parent 67f555d24e
commit a5372e4713
+9 -3
View File
@@ -107,7 +107,7 @@ let
inRootDir = true; inRootDir = true;
} }
'' ''
dumpdir="$1" dumpdir="''${1:?dumpdir not set}"
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
mkdir -p "$dumpdir" mkdir -p "$dumpdir"
${cabal-install}/bin/cabal v2-build ${devCabalOptions} \ ${cabal-install}/bin/cabal v2-build ${devCabalOptions} \
@@ -141,7 +141,10 @@ let
name = "postgrest-hsie-graph-modules"; name = "postgrest-hsie-graph-modules";
docs = "Create a PNG graph of modules imported within the codebase."; docs = "Create a PNG graph of modules imported within the codebase.";
} }
''${hsie} graph-modules main src | ${graphviz}/bin/dot -Tpng -o "$1"''; ''
outfile="''${1:?outfile not set}"
${hsie} graph-modules main src | ${graphviz}/bin/dot -Tpng -o "$outfile"
'';
hsieGraphSymbols = hsieGraphSymbols =
checkedShellScript checkedShellScript
@@ -149,7 +152,10 @@ let
name = "postgrest-hsie-graph-symbols"; name = "postgrest-hsie-graph-symbols";
docs = "Create a PNG graph of symbols imported within the codebase."; docs = "Create a PNG graph of symbols imported within the codebase.";
} }
''${hsieMinimalImports} graph-symbols | ${graphviz}/bin/dot -Tpng -o "$1"''; ''
outfile="''${1:?outfile not set}"
${hsieMinimalImports} graph-symbols | ${graphviz}/bin/dot -Tpng -o "$outfile"
'';
in in
buildEnv { buildEnv {
name = "postgrest-devtools"; name = "postgrest-devtools";