nix: add withTmpDir to checked-shell-script

This commit is contained in:
Wolfgang Walther
2021-04-12 19:03:16 +02:00
committed by Wolfgang Walther
parent 579a626de2
commit fc791a6320
3 changed files with 17 additions and 16 deletions
+2 -4
View File
@@ -105,17 +105,16 @@ let
name = "postgrest-dump-minimal-imports";
docs = "Dump minimal imports into given directory.";
inRootDir = true;
withTmpDir = true;
}
''
dumpdir="''${1:?dumpdir not set}"
tmpdir="$(mktemp -d)"
mkdir -p "$dumpdir"
${cabal-install}/bin/cabal v2-build ${devCabalOptions} \
--builddir="$tmpdir" \
--ghc-option=-ddump-minimal-imports \
--ghc-option=-dumpdir="$dumpdir" \
1>&2
rm -rf "$tmpdir"
# Fix OverloadedRecordFields imports
# shellcheck disable=SC2016
@@ -127,12 +126,11 @@ let
{
name = "postgrest-hsie-minimal-imports";
docs = "Run hsie with a provided dump of minimal imports.";
withTmpDir = true;
}
''
tmpdir="$(mktemp -d)"
${dumpMinimalImports} "$tmpdir"
${hsie} "$tmpdir" "$@"
rm -rf "$tmpdir"
'';
hsieGraphModules =