Merge pull request #360 from nix-community/better-error

all-formats: better error message if `find` doesn't return a result
This commit is contained in:
Jörg Thalheim 2024-09-02 19:26:18 +02:00 committed by GitHub
commit c8693048cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,6 +40,11 @@
pkgs.runCommand "${conf.config.system.build.${conf.config.formatAttr}.name}" {} ''
set -efu
target=$(find '${conf.config.system.build.${conf.config.formatAttr}}' -name '*${conf.config.fileExtension}' -xtype f -print -quit)
if [ -z "$target" ]; then
echo "No target file found for ${conf.config.formatAttr} format"
echo "Check the content of this build path: ${conf.config.system.build.${conf.config.formatAttr}}"
exit 1
fi
mkdir $out
ln -s "$target" "$out/$(basename "$target")"
''