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:
parent
ded170dd7c
commit
faeccf833e
1 changed files with 12 additions and 6 deletions
18
tabs/cli.js
18
tabs/cli.js
|
@ -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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue