mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-07 17:42:49 +08:00
Minor example updates
This commit is contained in:
@@ -188,7 +188,7 @@ function update() {
|
||||
if (image) return updateFirmware(dfu, device, image);
|
||||
})
|
||||
.then(() => {
|
||||
console.log("Update complete!");
|
||||
console.log("Update complete");
|
||||
process.exit();
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
@@ -45,19 +45,19 @@
|
||||
};
|
||||
|
||||
Package.prototype.load = function() {
|
||||
try {
|
||||
return JSZip.loadAsync(this.buffer)
|
||||
.then(zipFile => {
|
||||
this.zipFile = zipFile;
|
||||
return JSZip.loadAsync(this.buffer)
|
||||
.then(zipFile => {
|
||||
this.zipFile = zipFile;
|
||||
try {
|
||||
return this.zipFile.file("manifest.json").async("string");
|
||||
})
|
||||
.then(content => {
|
||||
this.manifest = JSON.parse(content).manifest;
|
||||
return this;
|
||||
});
|
||||
} catch(e) {
|
||||
throw new Error("Unable to find manifest, is this a proper DFU package?");
|
||||
}
|
||||
} catch(e) {
|
||||
throw new Error("Unable to find manifest, is this a proper DFU package?");
|
||||
}
|
||||
})
|
||||
.then(content => {
|
||||
this.manifest = JSON.parse(content).manifest;
|
||||
return this;
|
||||
});
|
||||
};
|
||||
|
||||
Package.prototype.getImage = function(types) {
|
||||
|
||||
Reference in New Issue
Block a user