MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / terminalBackup

Function terminalBackup

src/settings/terminalSettings.js:326–349  ·  view source on GitHub ↗

* Creates a backup of the terminal installation

()

Source from the content-addressed store, hash-verified

324 * Creates a backup of the terminal installation
325 */
326 async function terminalBackup() {
327 try {
328 // Ask user to select backup location
329 const { url } = await FileBrowser("folder", strings["select folder"]);
330
331 loader.showTitleLoader();
332
333 // Create backup
334 const backupPath = await Terminal.backup();
335 await system.copyToUri(
336 backupPath,
337 url,
338 "aterm_backup.tar",
339 console.log,
340 console.error,
341 );
342 loader.removeTitleLoader();
343 alert(strings.success.toUpperCase(), `${strings["backup successful"]}.`);
344 } catch (error) {
345 loader.removeTitleLoader();
346 console.error("Terminal backup failed:", error);
347 toast(error.toString());
348 }
349 }
350
351 /**
352 * Restores terminal installation

Callers 1

callbackFunction · 0.85

Calls 4

FileBrowserFunction · 0.85
alertFunction · 0.85
errorMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected