From 4f08f4a18eb0a4bc84ee4a74a29e06de072800ba Mon Sep 17 00:00:00 2001 From: Obelous <47227283+0belous@users.noreply.github.com> Date: Sun, 2 Nov 2025 23:36:14 +0000 Subject: [PATCH] Ignore commented lines --- update.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update.js b/update.js index 77b8ac7..a6a8455 100644 --- a/update.js +++ b/update.js @@ -9,14 +9,14 @@ const imageBaseUrl = 'https://raw.githubusercontent.com/0belous/universal-plugin async function getSources(){ let sources = []; try { - const fileContent = await fs.readFile('sources.txt', 'utf8'); - sources = fileContent.split(/\r?\n/).filter(line => line.trim() !== ''); + const fileContent = await fs.readFile('sources.txt', 'utf8'); + sources = fileContent.split(/\r?\n/).filter(line => line.trim() !== '' && !line.trim().startsWith('#')); } catch (err) { console.error("Error reading sources.txt:", err); - return []; + return []; } - let mergedData = []; + let mergedData = []; for(const url of sources){ try { @@ -37,7 +37,7 @@ async function getSources(){ } } - return mergedData; + return mergedData; } async function clearImagesFolder() {