Skip to content

Commit bd7d78e

Browse files
authored
remove update.json and meta.json files in ppk (#15)
* add logic to support SENTRY_PROPERTIES parameter * remove update.json and meta.json files in ppk * udpapte
1 parent 91a6029 commit bd7d78e

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/bundle.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,22 @@ async function copyHarmonyBundle(outputFolder: string) {
288288
}
289289
await fs.remove(path.join(harmonyRawPath, 'update.json'));
290290
await fs.copy('update.json', path.join(harmonyRawPath, 'update.json'));
291-
292291
await fs.ensureDir(outputFolder);
293-
await fs.copy(harmonyRawPath, outputFolder);
292+
293+
const files = await fs.readdir(harmonyRawPath);
294+
for (const file of files) {
295+
if (file !== 'update.json' && file !== 'meta.json') {
296+
const sourcePath = path.join(harmonyRawPath, file);
297+
const destPath = path.join(outputFolder, file);
298+
const stat = await fs.stat(sourcePath);
299+
300+
if (stat.isFile()) {
301+
await fs.copy(sourcePath, destPath);
302+
} else if (stat.isDirectory()) {
303+
await fs.copy(sourcePath, destPath);
304+
}
305+
}
306+
}
294307
} catch (error: any) {
295308
console.error(t('copyHarmonyBundleError', { error }));
296309
throw new Error(t('copyFileFailed', { error: error.message }));

0 commit comments

Comments
 (0)