Add exportFileBinary to FlipperLib
Reviewed By: antonk52 Differential Revision: D39692937 fbshipit-source-id: 7b3c78d004a9734cd8ae660d5782be1f02c00009
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f3b7552338
commit
3314c77ce9
@@ -151,6 +151,18 @@ export async function initializeElectron(
|
||||
await fs.promises.writeFile(filePath, data, {encoding});
|
||||
return filePath;
|
||||
},
|
||||
async exportFileBinary(data, {defaultPath} = {}) {
|
||||
const {filePath} = await electronIpcClient.send('showSaveDialog', {
|
||||
defaultPath,
|
||||
});
|
||||
|
||||
if (!filePath) {
|
||||
return;
|
||||
}
|
||||
|
||||
await fs.promises.writeFile(filePath, data, {encoding: 'binary'});
|
||||
return filePath;
|
||||
},
|
||||
openLink(url: string) {
|
||||
shell.openExternal(url);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user