Skip to content

Commit

Permalink
chore: 💊 update check lines workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
flixlix authored Jul 25, 2023
1 parent 1794a86 commit 9cd85e3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/check_localize_lines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ jobs:
# Navigate to the languages directory
cd src/localize/languages
# Get the list of all JSON files
files=$(ls *.json)
# Check the number of lines in the first file
expected_lines=$(wc -l < "$files")
# Initialize a variable to store the expected line count
expected_lines=""
# Get the list of all JSON files and loop through them
for file in *.json; do
# Check the number of lines in the first file only
if [ -z "$expected_lines" ]; then
expected_lines=$(wc -l < "$file")
fi
# Loop through all files and check the line count
for file in $files; do
# Check the line count of the current file
current_lines=$(wc -l < "$file")
# Compare the current file's line count with the expected line count
if [ "$current_lines" -ne "$expected_lines" ]; then
echo "ERROR: $file does not have the same number of lines as other JSON files."
exit 1
fi
done
echo "SUCCESS: All JSON files have$expected_lines lines."

0 comments on commit 9cd85e3

Please sign in to comment.