From 7561d51f2632d088514c68d88f9b8e0f2d2f8a7e Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 22 Jul 2024 10:21:32 -0500 Subject: [PATCH] Guard running of the find command --- nix/validate.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/validate.nix b/nix/validate.nix index 464fd1e..e433806 100644 --- a/nix/validate.nix +++ b/nix/validate.nix @@ -12,7 +12,9 @@ writeShellApplication { ]; text = '' shopt -s globstar - find "''${PACKER_CONFIG_DIR}" -name '*_linux_amd64' -exec chmod +x '{}' ";" + if [ -e "''${PACKER_CONFIG_DIR}" ]; then + find "''${PACKER_CONFIG_DIR}" -name '*_linux_amd64' -exec chmod +x '{}' ";" + fi packer init sources for vars in distros/**/*.pkrvars.hcl; do packer validate -except=upload "-var-file=''${vars}" sources/