mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 01:41:37 +08:00
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
This commit is contained in:
@@ -288,9 +288,22 @@ async function copyHarmonyBundle(outputFolder: string) {
|
||||
}
|
||||
await fs.remove(path.join(harmonyRawPath, 'update.json'));
|
||||
await fs.copy('update.json', path.join(harmonyRawPath, 'update.json'));
|
||||
|
||||
await fs.ensureDir(outputFolder);
|
||||
await fs.copy(harmonyRawPath, outputFolder);
|
||||
|
||||
const files = await fs.readdir(harmonyRawPath);
|
||||
for (const file of files) {
|
||||
if (file !== 'update.json' && file !== 'meta.json') {
|
||||
const sourcePath = path.join(harmonyRawPath, file);
|
||||
const destPath = path.join(outputFolder, file);
|
||||
const stat = await fs.stat(sourcePath);
|
||||
|
||||
if (stat.isFile()) {
|
||||
await fs.copy(sourcePath, destPath);
|
||||
} else if (stat.isDirectory()) {
|
||||
await fs.copy(sourcePath, destPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(t('copyHarmonyBundleError', { error }));
|
||||
throw new Error(t('copyFileFailed', { error: error.message }));
|
||||
|
Reference in New Issue
Block a user