From 66da4ffe1751dd8069cb8a5e9555734a790692f3 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 4 Aug 2020 22:51:27 +0200 Subject: [PATCH] feat(build): check that we copied all binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometmmes a new binary is added to an output, like in the `dhall-yaml` case, where yaml-to-dhall was added. This uses `lr` because I can’t be bothered to figure out how to use `find` to the same effect. --- build.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.nix b/build.nix index 1575ef2..a531338 100644 --- a/build.nix +++ b/build.nix @@ -24,7 +24,15 @@ pkgs.stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin binPath="$out/bin/${binName}" - install -D -m555 -T ${binName} "$binPath" + install -D -m555 -T "${binName}" "$binPath" + rm "${binName}" + + # check that we didn’t forget any files (maybe a new binary was added) + if [ ! -z "$(${pkgs.lr}/bin/lr -1 -t 'depth == 1' .)" ]; then + echo "still some files remaining!" >&2 + ${pkgs.lr}/bin/lr . + exit 1 + fi "$binPath" --bash-completion-script "$binPath" > "${binName}.bash" installShellCompletion --bash "${binName}.bash"