mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 01:52:05 +03:00
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:
commit
c8693048cd
@ -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")"
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user