MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / destroy

Function destroy

services.ts:3765–3787  ·  view source on GitHub ↗
(item:directoryItem)

Source from the content-addressed store, hash-verified

3763 let a:number = 0;
3764 const len:number = filelist.length,
3765 destroy = function node_apps_remove_removeItems_destroy(item:directoryItem) {
3766 const type:"rmdir"|"unlink" = (item[1] === "directory")
3767 ? "rmdir"
3768 : "unlink";
3769 node.fs[type](item[0], function node_apps_remove_removeItems_destroy_callback(er:nodeError):void {
3770 if (verbose === true && er !== null && er.toString().indexOf("no such file or directory") < 0) {
3771 if (er.code === "ENOTEMPTY") {
3772 node_apps_remove_removeItems_destroy(item);
3773 return;
3774 }
3775 apps.errout([er.toString()]);
3776 return;
3777 }
3778 if (item[0] === filelist[0][0]) {
3779 callback();
3780 } else {
3781 filelist[item[2]][3] = filelist[item[2]][3] - 1;
3782 if (filelist[item[2]][3] < 1) {
3783 node_apps_remove_removeItems_destroy(filelist[item[2]]);
3784 }
3785 }
3786 });
3787 };
3788 if (filelist.length < 1) {
3789 callback();
3790 return;

Callers 1

removeItemsFunction · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected