From ae3cdf28e053533c54f339b2077b249f28c4bdd4 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Sat, 22 Nov 2025 01:15:15 +0200 Subject: [PATCH] fix(ci): handle missing .env and .env.defaults in _env function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _env function crashed in CI when neither .env nor .env.defaults existed. The previous code unconditionally tried to copy .env.defaults to .env when .env was missing, but .env.defaults doesn't exist in the repository. Changed the logic to: - Only copy .env.defaults if it exists (elif instead of else) - Continue gracefully when neither file exists (CI environment) This fixes the build-deb step failure where the script exited with code 1 immediately after printing "Setting environment from .env and .env.defaults". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run b/run index 6d0f010..c2b7913 100755 --- a/run +++ b/run @@ -396,10 +396,12 @@ function _env { # the environment. First file has precedence! if [ -f .env ]; then _export_unset .env - else + elif [ -f .env.defaults ]; then # Make sure a .env file exists, otherwise docker-compose will complain cp .env.defaults .env + _export_unset .env fi + # If neither file exists, continue without env setup (CI environment) if [ -f .env.defaults ]; then _export_unset .env.defaults fi