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

Function restat

services.ts:2937–2982  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2935 len = 0,
2936 ers = "";
2937 const restat = function node_apps_makedir_stat_restat():void {
2938 node
2939 .fs
2940 .stat(
2941 dirs.slice(0, ind + 1).join(sep),
2942 function node_apps_makedir_stat_restat_callback(erra:nodeError, stata:Stats):void {
2943 let erras:string = "";
2944 ind = ind + 1;
2945 if (erra !== null) {
2946 erras = erra.toString();
2947 if (erras.indexOf("no such file or directory") > 0 || erra.code === "ENOENT") {
2948 node
2949 .fs
2950 .mkdir(
2951 dirs.slice(0, ind).join(sep),
2952 function node_apps_makedir_stat_restat_callback_mkdir(errb:Error):void {
2953 if (errb !== null && errb.toString().indexOf("file already exists") < 0) {
2954 apps.errout([errb.toString()]);
2955 return;
2956 }
2957 if (ind < len) {
2958 node_apps_makedir_stat_restat();
2959 } else {
2960 callback();
2961 }
2962 }
2963 );
2964 return;
2965 }
2966 if (erras.indexOf("file already exists") < 0) {
2967 apps.errout([erra.toString()]);
2968 return;
2969 }
2970 }
2971 if (stata.isFile() === true) {
2972 apps.errout([`Destination directory, '${text.cyan + dirToMake + text.none}', is a file.`]);
2973 return;
2974 }
2975 if (ind < len) {
2976 node_apps_makedir_stat_restat();
2977 } else {
2978 callback();
2979 }
2980 }
2981 );
2982 };
2983 if (err !== null) {
2984 ers = err.toString();
2985 if (ers.indexOf("no such file or directory") > 0 || err.code === "ENOENT") {

Callers 1

services.tsFile · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected