Skip to content

Commit

Permalink
remove duplicate empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
gvoze32 committed Jun 12, 2024
1 parent 6613e6b commit a989a35
Show file tree
Hide file tree
Showing 2 changed files with 250 additions and 261 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
run: |
domain=$(jq -r '.issue.body' "$GITHUB_EVENT_PATH" | sed -n '3p')
sed "/$domain/d" releases/hosts > releases/hosts.tmp
rm releases/hosts
mv releases/hosts.tmp releases/hosts
awk 'BEGIN{RS=""; ORS="\n\n"} {gsub(/\n\n+/, "\n"); print}' releases/hosts.tmp > releases/hosts
- name: Install Dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -54,15 +53,6 @@ jobs:
- name: Release hosts
run: |
cat hosts-hasilsorted | sudo tee -a releases/hosts > /dev/null
- name: Remove Adjacent Empty Lines
run: |
remove_adjacent_empty_lines() {
local file_path="$1"
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'
remove_adjacent_empty_lines "$file_path"
- name: Commit changes
env:
issue_number: ${{ github.event.issue.number }}
Expand Down
Loading

0 comments on commit a989a35

Please sign in to comment.