1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 17:25:16 +03:00

Fixed overwriting of existing files in CLI.

This commit is contained in:
mikeller 2017-08-12 23:09:23 +12:00
parent ded170dd7c
commit faeccf833e

View file

@ -48,15 +48,21 @@ TABS.cli.initialize = function (callback) {
return; return;
} }
entry.createWriter(function(writer) { entry.createWriter(function (writer) {
writer.onerror = function (){ writer.onerror = function (){
console.error('Failed to write file'); console.error('Failed to write file');
}; };
writer.onwriteend = function(e) {
console.log('write complete'); writer.onwriteend = function () {
}; if (writer.length === 0) {
writer.write(new Blob([self.outputHistory], {type: 'text/plain'})); writer.write(new Blob([self.outputHistory], {type: 'text/plain'}));
},function (){ } else {
console.log('write complete');
};
}
writer.truncate(0);
}, function (){
console.error('Failed to get file writer'); console.error('Failed to get file writer');
}); });
}); });