1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-10-28 20:13:10 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
sunnylqm
2025-10-24 17:01:50 +08:00
parent 1b4c03924a
commit 6e4f432e26
12 changed files with 343 additions and 746 deletions

View File

@@ -57,7 +57,7 @@ export class DownloadTask {
try {
try {
const exists = fileIo.accessSync(params.targetFile);
let exists = fileIo.accessSync(params.targetFile);
if (exists) {
await fileIo.unlink(params.targetFile);
} else {
@@ -65,7 +65,7 @@ export class DownloadTask {
0,
params.targetFile.lastIndexOf('/'),
);
const exists = fileIo.accessSync(targetDir);
exists = fileIo.accessSync(targetDir);
if (!exists) {
await fileIo.mkdir(targetDir);
}

View File

@@ -17,7 +17,7 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
async getBundle(): Promise<ArrayBuffer> {
try {
this.filePath = this.updateContext.getBundleUrl();
this.filePath = this.updateContext.getBundleUrl();
const res = fileIo.accessSync(this.filePath);
if (res) {
const file = fileIo.openSync(this.filePath, fileIo.OpenMode.READ_ONLY);

View File

@@ -101,6 +101,7 @@ export class UpdateContext {
params.hash = hash;
params.listener = listener;
params.targetFile = `${this.rootDir}/${hash}.ppk`;
params.unzipDirectory = `${this.rootDir}/${hash}`;
const downloadTask = new DownloadTask(this.context);
await downloadTask.execute(params);
} catch (e) {
@@ -162,8 +163,8 @@ export class UpdateContext {
const downloadTask = new DownloadTask(this.context);
return await downloadTask.execute(params);
} catch (e) {
throw e;
console.error('Failed to download APK patch:', e);
throw e;
}
}