1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-02 15:27:59 +03:00

image-builder: Prevent bogus empty filesystems

This commit is contained in:
Samuel Dionne-Riel 2023-02-02 16:20:53 -05:00
parent 02e1c0a62e
commit cad65d269e

View File

@ -238,6 +238,19 @@ in
(
cd "$files"
${config.populateCommands}
# This also activates dotglob automatically.
# Using this means hidden files will be added too.
GLOBIGNORE=".:.."
if (( $(find -maxdepth 1 | wc -l) == 1 )); then
(set -x; ls -l)
echo ""
echo "ERROR: populatePhase produced no files."
echo " tip: using mkForce or mkDefault at different places may unexpected overwrite values."
exit 2
fi
)
'';