Skip to content

Commit

Permalink
Merge pull request #270 from hatemhosny/fix-fetch-algorithms
Browse files Browse the repository at this point in the history
Fix fetching algorithms
  • Loading branch information
maltejur committed Oct 16, 2023
2 parents b811e1e + 74880a9 commit 26792f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Repositories = {
},
r: {
name: "R",
allowedFiles: [".R"],
allowedFiles: [".r"],
baseDir: ".",
},
ruby: {
Expand Down
6 changes: 3 additions & 3 deletions scripts/fetch-algorithms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const categoriesToSkip = ["main", "src", "algorithms", "problems"];
(repo) =>
new Promise<void>((resolve, reject) => {
exec(
`git clone https://github.com/TheAlgorithms/${repo}.git`,
`git clone --depth 1 https://github.com/TheAlgorithms/${repo}.git`,
(err) => {
if (err) reject(err);
else resolve();
Expand Down Expand Up @@ -550,10 +550,10 @@ const categoriesToSkip = ["main", "src", "algorithms", "problems"];
function isValidCategory(name: string) {
if (normalize(name).match(/problem\d+/)) return false;
for (const exclude of categoriesToIgnore)
for (const category of name.split("/"))
for (const category of name.split(path.sep))
if (normalize(category) === normalize(exclude)) return false;
for (const exclude of ["__init__", "mod.rs"])
for (const category of name.split("/"))
for (const category of name.split(path.sep))
if (category === exclude) return false;
return true;
}

0 comments on commit 26792f7

Please sign in to comment.