From 9a229f87726c1931f2fd7b0a35fe47feb0607a29 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Thu, 8 Dec 2022 23:41:44 +0800 Subject: [PATCH] CI: fix Telegram CIDR build --- Build/build-telegram-cidr.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Build/build-telegram-cidr.js b/Build/build-telegram-cidr.js index f193e859..780d4816 100644 --- a/Build/build-telegram-cidr.js +++ b/Build/build-telegram-cidr.js @@ -2,8 +2,7 @@ const { fetchWithRetry } = require('./lib/fetch-retry'); const fs = require('fs'); const path = require('path'); const { isIPv4, isIPv6 } = require('net'); -const { compareAndWriteFile } = require('./lib/string-array-compare'); -const { withBannerArray } = require('./lib/with-banner'); +const { withBanner } = require('./lib/with-banner'); (async () => { console.time('Total Time - build-telegram-cidr'); @@ -21,8 +20,9 @@ const { withBannerArray } = require('./lib/with-banner'); throw new Error('Failed to fetch data!'); } - await compareAndWriteFile( - withBannerArray( + await fs.promises.writeFile( + path.resolve(__dirname, '../List/ip/telegram.conf'), + withBanner( 'Sukka\'s Surge Rules - Telegram IP CIDR', [ 'License: AGPL 3.0', @@ -43,8 +43,7 @@ const { withBannerArray } = require('./lib/with-banner'); } return ''; }) - ), - path.resolve(__dirname, '../List/ip/telegram.conf') + ) ) console.timeEnd('Total Time - build-telegram-cidr');