Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Update bug.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gvoze32 authored Jun 12, 2024
1 parent 5b6b22a commit 0f84cd8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ jobs:
- name: Release hosts
run: |
cat hosts-hasilsorted | sudo tee -a hosts > /dev/null
- name: Remove Adjacent Empty Lines
run: |
import re
def remove_adjacent_empty_lines(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()
new_lines = []
prev_line_empty = False

for line in lines:
if line.strip() == '':
if prev_line_empty:
continue
else:
new_lines.append(line)
prev_line_empty = True
else:
new_lines.append(line)
prev_line_empty = False

with open(file_path, 'w') as file:
file.writelines(new_lines)

file_path = 'hosts'
remove_adjacent_empty_lines(file_path)
- name: Commit changes
run: |
git config --global user.email "[email protected]"
Expand Down

0 comments on commit 0f84cd8

Please sign in to comment.