MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / findFile

Function findFile

main.js:711–731  ·  view source on GitHub ↗
(dir, regexp, callback)

Source from the content-addressed store, hash-verified

709}
710
711function findFile (dir, regexp, callback) {
712 fs.readdir(dir, {withFileTypes: true}, (err, files) => {
713 if (err) {
714 console.error('Cannot lookup for file', dir);
715 callback(null);
716 } else {
717 for (let i = 0; i < files.length; i++) {
718 const fileName = files[i].name;
719 let match = fileName.match(regexp);
720 if (match && match.length) {
721 if (match[0].length === fileName.length) {
722 callback(fileName);
723 return;
724 }
725 }
726 }
727 console.error('None of the files match regexp!', regexp, JSON.stringify(files));
728 callback(null);
729 }
730 });
731}
732
733function toDisplayAlgorithm (algorithm) {
734 switch (algorithm) {

Callers 1

getBuildFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected