MCPcopy
hub / github.com/ollm/OpenComic / deletePermanently

Function deletePermanently

scripts/dom.js:2634–2666  ·  view source on GitHub ↗
(path, fromIndexNotMasterFolders = false, confirm = false)

Source from the content-addressed store, hash-verified

2632}
2633
2634async function deletePermanently(path, fromIndexNotMasterFolders = false, confirm = false)
2635{
2636 if(confirm)
2637 {
2638 await dom.poster.findAndDelete(path, false, true);
2639
2640 fs.rmSync(path, {recursive: true});
2641
2642 if(fromIndexNotMasterFolders)
2643 dom.removeComic(path, true, false);
2644
2645 dom.reload();
2646 }
2647 else
2648 {
2649 events.dialog({
2650 header: language.global.contextMenu.deletePermanently,
2651 width: 400,
2652 height: false,
2653 content: language.global.contextMenu.deletePermanentlyConfirm,
2654 buttons: [
2655 {
2656 text: language.buttons.cancel,
2657 function: 'events.closeDialog();',
2658 },
2659 {
2660 text: language.global.contextMenu.deletePermanently,
2661 function: 'events.closeDialog(); dom.deletePermanently(\''+escapeQuotes(escapeBackSlash(path), 'simples')+'\', '+(fromIndexNotMasterFolders ? 'true' : 'false')+', true);',
2662 }
2663 ],
2664 });
2665 }
2666}
2667
2668
2669var readingActive = false, skipNextComic = false, skipPreviousComic = false;

Callers

nothing calls this directly

Calls 2

escapeQuotesFunction · 0.85
escapeBackSlashFunction · 0.85

Tested by

no test coverage detected