Minor example updates

This commit is contained in:
Rob Moran
2018-01-07 21:09:39 +00:00
parent 93fb9c13ca
commit d7f397b2fd
2 changed files with 13 additions and 13 deletions

View File

@@ -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 => {

View File

@@ -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) {