capacitor-ota 1.0.9 → 1.0.10
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/dist/src/index.mjs +4 -3
- package/package.json +2 -2
package/dist/src/index.mjs
CHANGED
|
@@ -70,7 +70,7 @@ var OtaUpdater = class {
|
|
|
70
70
|
});
|
|
71
71
|
try {
|
|
72
72
|
const url = `${this.config.staticUrl}/updates/${this.config.appId}.json`;
|
|
73
|
-
const response = await fetch(url
|
|
73
|
+
const response = await fetch(url);
|
|
74
74
|
if (!response.ok) {
|
|
75
75
|
if (response.status === 404) {
|
|
76
76
|
this.setState({ status: "idle" });
|
|
@@ -131,7 +131,7 @@ var OtaUpdater = class {
|
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
133
|
const url = `${this.config.staticUrl}/updates/${this.config.appId}.json`;
|
|
134
|
-
const data = await (await fetch(url
|
|
134
|
+
const data = await (await fetch(url)).json();
|
|
135
135
|
const { CapacitorUpdater } = await import("@capgo/capacitor-updater");
|
|
136
136
|
const listener = await CapacitorUpdater.addListener("download", (event) => {
|
|
137
137
|
this.setState({ progress: event.percent });
|
|
@@ -140,8 +140,9 @@ var OtaUpdater = class {
|
|
|
140
140
|
version
|
|
141
141
|
});
|
|
142
142
|
});
|
|
143
|
+
const bundleUrl = data.url.startsWith("http") ? data.url : `${this.config.staticUrl}${data.url}`;
|
|
143
144
|
const bundle = await CapacitorUpdater.download({
|
|
144
|
-
url:
|
|
145
|
+
url: bundleUrl,
|
|
145
146
|
version: data.version,
|
|
146
147
|
checksum: data.checksum
|
|
147
148
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-ota",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.mjs",
|
|
6
6
|
"types": "dist/src/index.d.mts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"panel:dev": "vite dev --host",
|
|
24
24
|
"panel:build": "vite build",
|
|
25
25
|
"panel:preview": "vite preview",
|
|
26
|
-
"build:web": "vite build && wrangler deploy",
|
|
26
|
+
"build:web": "vite build && npx wrangler --cwd .output/ deploy",
|
|
27
27
|
"db:migrate": "wrangler d1 migrations apply ota-db --local",
|
|
28
28
|
"db:migrate:remote": "wrangler d1 migrations apply ota-db --remote",
|
|
29
29
|
"cli": "tsx cli/ota.ts"
|