From 5184e4992a670b3ad32e469d497958e2eec59bad Mon Sep 17 00:00:00 2001 From: Syafa Adena Date: Thu, 13 Jun 2024 00:10:23 +0700 Subject: [PATCH] minor fix 2 --- .github/workflows/bug.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bug.yml b/.github/workflows/bug.yml index ef386403..603b711b 100644 --- a/.github/workflows/bug.yml +++ b/.github/workflows/bug.yml @@ -58,13 +58,10 @@ jobs: run: | remove_adjacent_empty_lines() { local file_path="$1" - local temp_file=$(mktemp) - - awk 'NF || !p {print} {p = !NF}' "$file_path" > "$temp_file" - mv "$temp_file" "$file_path" + awk 'BEGIN { prev_blank=0 } { if ($0 ~ /^$/) { if (prev_blank == 0) print; prev_blank=1 } else { print; prev_blank=0 } }' "$file_path" > temp && mv temp "$file_path" } - file_path='releases/hosts' + file_path='hosts' remove_adjacent_empty_lines "$file_path" - name: Commit changes env: