capacitor-ota 1.0.1 → 1.0.3
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/cli/ota.mjs +2 -2
- package/dist/src/index.mjs +3 -2
- package/package.json +1 -1
package/dist/cli/ota.mjs
CHANGED
|
@@ -138,8 +138,8 @@ async function setUrl(url) {
|
|
|
138
138
|
async function showConfig() {
|
|
139
139
|
const config = loadConfig();
|
|
140
140
|
console.log("\n⚙️ Config:\n");
|
|
141
|
-
console.log(` URL:
|
|
142
|
-
console.log(` Token:
|
|
141
|
+
console.log(` API URL: ${config.url}`);
|
|
142
|
+
console.log(` Token: ${config.token ? "********" : "(not set)"}\n`);
|
|
143
143
|
}
|
|
144
144
|
function printHelp() {
|
|
145
145
|
console.log(`
|
package/dist/src/index.mjs
CHANGED
|
@@ -55,7 +55,8 @@ var OtaUpdater = class {
|
|
|
55
55
|
if (!isNativePlatform()) return;
|
|
56
56
|
try {
|
|
57
57
|
const { CapacitorUpdater } = await import("@capgo/capacitor-updater");
|
|
58
|
-
await CapacitorUpdater.notifyAppReady();
|
|
58
|
+
const result = await CapacitorUpdater.notifyAppReady();
|
|
59
|
+
if (result?.bundle?.version) this.state.currentVersion = result.bundle.version;
|
|
59
60
|
} catch {}
|
|
60
61
|
}
|
|
61
62
|
async check() {
|
|
@@ -74,7 +75,7 @@ var OtaUpdater = class {
|
|
|
74
75
|
throw new Error(`HTTP ${response.status}`);
|
|
75
76
|
}
|
|
76
77
|
const data = await response.json();
|
|
77
|
-
if (compareVersions(data.version, this.
|
|
78
|
+
if (compareVersions(data.version, this.state.currentVersion) > 0) {
|
|
78
79
|
this.setState({ newVersion: data.version });
|
|
79
80
|
return true;
|
|
80
81
|
}
|