From c725e16a48e8c9a6759acb5d65ad0010c7a65135 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Wed, 20 Mar 2024 13:03:45 -0300 Subject: [PATCH] Improved comment line check --- bin/compile | 2 +- bin/report | 2 +- test/fixtures/package-names/Aptfile | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index 8abb4a5..8e6b7de 100755 --- a/bin/compile +++ b/bin/compile @@ -96,7 +96,7 @@ while IFS= read -r PACKAGE; do IFS=$' \t' read -ra PACKAGE_NAMES <<< "$PACKAGE" apt-get "${APT_OPTIONS[@]}" -y "${APT_FORCE_YES[@]}" -d install --reinstall "${PACKAGE_NAMES[@]}" | indent fi -done < <(grep --invert-match -e "^#" -e "^\s*$" -e "^:repo:" "${BUILD_DIR}/Aptfile") +done < <(grep --invert-match -e "^\s*#" -e "^\s*$" -e "^:repo:" "${BUILD_DIR}/Aptfile") mkdir -p "$BUILD_DIR/.apt" diff --git a/bin/report b/bin/report index ce294dc..1421bba 100755 --- a/bin/report +++ b/bin/report @@ -23,7 +23,7 @@ while IFS= read -r line; do packages+=("${package_name}") done fi -done < <(grep --invert-match -e "^#" -e "^\s*$" "${BUILD_DIR}/Aptfile") +done < <(grep --invert-match -e "^\s*#" -e "^\s*$" "${BUILD_DIR}/Aptfile") output_key_value() { local key value diff --git a/test/fixtures/package-names/Aptfile b/test/fixtures/package-names/Aptfile index 6c5c25e..15fa750 100644 --- a/test/fixtures/package-names/Aptfile +++ b/test/fixtures/package-names/Aptfile @@ -6,3 +6,5 @@ mysql-client-* # multiple packages on single line s3cmd wget + + # comment with bad indent