mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
JS-6410: export import
This commit is contained in:
parent
66a7a33704
commit
edf33963e8
2 changed files with 28 additions and 1 deletions
|
@ -259,6 +259,20 @@ class Api {
|
|||
};
|
||||
};
|
||||
|
||||
shortcutExport (win, dst, data) {
|
||||
try {
|
||||
fs.writeFileSync(path.join(dst, 'shortcut.json'), JSON.stringify(data, null, '\t'), 'utf8');
|
||||
} catch (err) {};
|
||||
};
|
||||
|
||||
shortcutImport (win, src) {
|
||||
let data = {};
|
||||
if (fs.existsSync(src)) {
|
||||
try { data = JSON.parse(fs.readFileSync(src, 'utf8')); } catch (err) {};
|
||||
};
|
||||
return data;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
module.exports = new Api();
|
Loading…
Add table
Add a link
Reference in a new issue