MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / checkForUpdates

Method checkForUpdates

data/src/emulator.js:176–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 })
175 }
176 checkForUpdates() {
177 if (this.ejs_version.endsWith("-beta")) {
178 console.warn("Using EmulatorJS beta. Not checking for updates. This instance may be out of date. Using stable is highly recommended unless you build and ship your own cores.");
179 return;
180 }
181 fetch("https://cdn.emulatorjs.org/stable/data/version.json").then(response => {
182 if (response.ok) {
183 response.text().then(body => {
184 let version = JSON.parse(body);
185 if (this.versionAsInt(this.ejs_version) < this.versionAsInt(version.version)) {
186 console.log(`Using EmulatorJS version ${this.ejs_version} but the newest version is ${version.current_version}\nopen https://github.com/EmulatorJS/EmulatorJS to update`);
187 }
188 })
189 }
190 })
191 }
192 versionAsInt(ver) {
193 if (ver.endsWith("-beta")) {
194 return 99999999;

Callers 1

constructorMethod · 0.95

Calls 1

versionAsIntMethod · 0.95

Tested by

no test coverage detected