* Creates a backup of the terminal installation
()
| 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 |
no test coverage detected