Skip to content

Commit

Permalink
again
Browse files Browse the repository at this point in the history
  • Loading branch information
rachfop committed May 2, 2024
1 parent bfde1e7 commit b39df74
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class Sync {
});
return result.data;
}
async reportUnusedRepos(usedRepos) {
reportUnusedRepos(usedRepos) {
const configRepos = new Set(
this.origins.map((origin) => `${origin.owner}/${origin.repo}`)
);
Expand All @@ -298,7 +298,6 @@ class Sync {
}
}
}
// extractSnippets returns an array of code snippets that are found in the repositories
async extractSnippets(repositories, usedRepos) {
const snippets = [];
this.progress.updateOperation("extracting snippets");
Expand All @@ -307,9 +306,6 @@ class Sync {
this.progress.updateTotal(filePaths.length);
const extractRootPath = join(rootDir, extractionDir);
for (const item of filePaths) {
if (fileSnips.length > 0) {
usedRepos.add(`${owner}/${repo}`);
}
const ext = determineExtension(item.name);
let itemPath = join(item.directory, item.name);
if (rtype == "remote") {
Expand All @@ -333,27 +329,20 @@ class Sync {
fileSnips.push(snip);
}
});
if (fileSnips.length > 0) {
usedRepos.add(`${owner}/${repo}`);
}
snippets.push(...fileSnips);
this.progress.increment();
}
})
);
return snippets;
}
reportUnusedRepos(usedRepos) {
const configRepos = new Set(
this.origins.map((origin) => `${origin.owner}/${origin.repo}`)
);
const unusedRepos = new Set(
[...configRepos].filter((repo) => !usedRepos.has(repo))
);
if (unusedRepos.size > 0) {
this.logger.warn("Unused repositories:");
for (const repo of unusedRepos) {
this.logger.warn(`- ${repo}`);
}
}
}




// getTargetFilesInfos identifies the paths to the target write files
async getTargetFilesInfos() {
this.progress.updateOperation("gathering information of target files");
Expand Down

0 comments on commit b39df74

Please sign in to comment.