feat(build): check that we copied all binaries

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.
This commit is contained in:
Profpatsch 2020-08-04 22:51:27 +02:00
parent 0104f0fd3e
commit 66da4ffe17
1 changed files with 9 additions and 1 deletions

View File

@ -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 didnt 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"