From cf679715a55f94c79ff644ea4b16c50789e1f77e Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Sat, 22 Nov 2025 01:16:18 +0800 Subject: [PATCH] Remove unused copiesv2 variable from diffFromPPK and diffFromPackage functions in bundle.ts to streamline JSON output. --- package.json | 2 +- src/bundle.ts | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index c0888f9..57a043d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-update-cli", - "version": "2.4.1", + "version": "2.4.2", "description": "command line tool for react-native-update (remote updates for react native)", "main": "index.js", "bin": { diff --git a/src/bundle.ts b/src/bundle.ts index 6e5f213..d08f743 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -578,7 +578,6 @@ async function diffFromPPK(origin: string, next: string, output: string) { } const copies = {}; - const copiesv2 = {}; const zipfile = new YazlZipFile(); @@ -640,7 +639,6 @@ async function diffFromPPK(origin: string, next: string, output: string) { addEntry(base); } copies[entry.fileName] = originMap[entry.crc32]; - copiesv2[entry.crc32] = entry.fileName; return; } @@ -673,7 +671,7 @@ async function diffFromPPK(origin: string, next: string, output: string) { //console.log({copies, deletes}); zipfile.addBuffer( - Buffer.from(JSON.stringify({ copies, copiesv2, deletes })), + Buffer.from(JSON.stringify({ copies, deletes })), '__diff.json', ); zipfile.end(); @@ -718,7 +716,6 @@ async function diffFromPackage( } const copies = {}; - const copiesv2 = {}; const zipfile = new YazlZipFile(); @@ -754,7 +751,6 @@ async function diffFromPackage( // If moved from other place if (originMap[entry.crc32]) { copies[entry.fileName] = originMap[entry.crc32]; - copiesv2[entry.crc32] = entry.fileName; return; } @@ -773,10 +769,7 @@ async function diffFromPackage( } }); - zipfile.addBuffer( - Buffer.from(JSON.stringify({ copies, copiesv2 })), - '__diff.json', - ); + zipfile.addBuffer(Buffer.from(JSON.stringify({ copies })), '__diff.json'); zipfile.end(); await writePromise; }