diff --git a/run b/run index aa5114e..c249acc 100755 --- a/run +++ b/run @@ -91,23 +91,14 @@ function build-deb { # Set up environment dev-env - echo "DEBUG: dev-env completed" # Check if changelog was already generated by CI (shared-workflows) # If debian/changelog exists and was modified in the last 5 minutes, skip regeneration - echo "DEBUG: Checking debian/changelog..." - echo "DEBUG: PWD=$(pwd)" - echo "DEBUG: ls -la debian/changelog: $(ls -la debian/changelog 2>&1 || echo 'file not found')" - if [ -f "debian/changelog" ]; then - echo "DEBUG: debian/changelog exists, checking age..." # Use stat -c for Linux, stat -f for macOS, handle errors gracefully CHANGELOG_MTIME=$(stat -c %Y debian/changelog 2>/dev/null) || CHANGELOG_MTIME=$(stat -f %m debian/changelog 2>/dev/null) || CHANGELOG_MTIME=0 - echo "DEBUG: CHANGELOG_MTIME=$CHANGELOG_MTIME" CURRENT_TIME=$(date +%s) - echo "DEBUG: CURRENT_TIME=$CURRENT_TIME" CHANGELOG_AGE=$((CURRENT_TIME - CHANGELOG_MTIME)) - echo "DEBUG: CHANGELOG_AGE=$CHANGELOG_AGE" if [ "$CHANGELOG_AGE" -lt 300 ]; then echo "📋 Using existing debian/changelog (generated by CI)" else @@ -122,11 +113,8 @@ function build-deb { --force-distribution \ "Automated release $PACKAGE_VERSION. See GitHub for details." fi - else - echo "DEBUG: debian/changelog does not exist" fi - echo "DEBUG: About to run dpkg-buildpackage..." dpkg-buildpackage -us -uc -b echo "✅ Debian package built successfully" @@ -427,7 +415,8 @@ function _export_unset { # Need to use a temp file to avoid a subshell local tmpfile=$(mktemp) - grep -v '^#' $file >$tmpfile + # Use || true to handle files with only comments (grep returns 1 when no matches) + grep -v '^#' "$file" >"$tmpfile" || true while read -r line; do if [[ ! "$line" =~ ^[[:space:]]*$ ]]; then