react-native-update-cli 1.46.1 → 1.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle.js +13 -1
- package/package.json +1 -1
- package/src/bundle.ts +15 -2
package/lib/bundle.js
CHANGED
|
@@ -288,7 +288,19 @@ async function copyHarmonyBundle(outputFolder) {
|
|
|
288
288
|
await _fsextra.remove(_path.default.join(harmonyRawPath, 'update.json'));
|
|
289
289
|
await _fsextra.copy('update.json', _path.default.join(harmonyRawPath, 'update.json'));
|
|
290
290
|
await _fsextra.ensureDir(outputFolder);
|
|
291
|
-
await _fsextra.
|
|
291
|
+
const files = await _fsextra.readdir(harmonyRawPath);
|
|
292
|
+
for (const file of files){
|
|
293
|
+
if (file !== 'update.json' && file !== 'meta.json') {
|
|
294
|
+
const sourcePath = _path.default.join(harmonyRawPath, file);
|
|
295
|
+
const destPath = _path.default.join(outputFolder, file);
|
|
296
|
+
const stat = await _fsextra.stat(sourcePath);
|
|
297
|
+
if (stat.isFile()) {
|
|
298
|
+
await _fsextra.copy(sourcePath, destPath);
|
|
299
|
+
} else if (stat.isDirectory()) {
|
|
300
|
+
await _fsextra.copy(sourcePath, destPath);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
292
304
|
} catch (error) {
|
|
293
305
|
console.error((0, _i18n.t)('copyHarmonyBundleError', {
|
|
294
306
|
error
|
package/package.json
CHANGED
package/src/bundle.ts
CHANGED
|
@@ -288,9 +288,22 @@ async function copyHarmonyBundle(outputFolder: string) {
|
|
|
288
288
|
}
|
|
289
289
|
await fs.remove(path.join(harmonyRawPath, 'update.json'));
|
|
290
290
|
await fs.copy('update.json', path.join(harmonyRawPath, 'update.json'));
|
|
291
|
-
|
|
292
291
|
await fs.ensureDir(outputFolder);
|
|
293
|
-
|
|
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
|
+
}
|
|
294
307
|
} catch (error: any) {
|
|
295
308
|
console.error(t('copyHarmonyBundleError', { error }));
|
|
296
309
|
throw new Error(t('copyFileFailed', { error: error.message }));
|