mirror of
https://github.com/iptv-org/epg
synced 2026-09-10 13:56:51 -04:00
update worker validation
This commit is contained in:
@@ -63,25 +63,4 @@ jobs:
|
|||||||
npm run channels:validate -- ${{ steps.files.outputs.channels_all_changed_files }}
|
npm run channels:validate -- ${{ steps.files.outputs.channels_all_changed_files }}
|
||||||
- name: Check changed workers.txt file
|
- name: Check changed workers.txt file
|
||||||
if: steps.files.outputs.workers_any_changed == 'true'
|
if: steps.files.outputs.workers_any_changed == 'true'
|
||||||
run: |
|
run: npm run workers:validate
|
||||||
node -e "
|
|
||||||
const fs = require('fs');
|
|
||||||
const lines = fs.readFileSync('workers.txt', 'utf8').split('\n');
|
|
||||||
let errors = 0;
|
|
||||||
|
|
||||||
lines.forEach((line, index) => {
|
|
||||||
if (index === lines.length - 1 && !line.trim()) return;
|
|
||||||
const lineNum = index + 1;
|
|
||||||
|
|
||||||
if (!line.endsWith('\r')) {
|
|
||||||
console.error(' workers.txt\n ' + lineNum + ':1 line must use CRLF (Windows) line endings');
|
|
||||||
errors++;
|
|
||||||
}
|
|
||||||
if (line.includes(' ')) {
|
|
||||||
console.error(' workers.txt\n ' + lineNum + ':1 line cannot contain spaces');
|
|
||||||
errors++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (errors > 0) process.exit(1);
|
|
||||||
"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user