Skip to content

Commit

Permalink
fix build errors on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maltejur committed May 27, 2021
1 parent 7113c08 commit 828ce98
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/fetch-algorithms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ let spinner: Ora;
if (!valid) continue;
if (!isValidCategory(dir)) continue;
if (
dir.split("/").length -
path.join(language, repo.baseDir).split("/").length <
dir.split(path.sep).length -
path.join(language, repo.baseDir).split(path.sep).length <
2
)
continue; // Ignore top level files
const name = normalizeTitle(
dir.split("/").pop().split(".")[0].replace(/_/g, " ")
dir.split(path.sep).pop().split(".")[0].replace(/_/g, " ")
);
const nName = normalize(name);
const lCategories = dir
.split("/")
.split(path.sep)
.slice(
path.join(language, repo.baseDir).split("/").length,
dir.split("/").length - 1
path.join(language, repo.baseDir).split(path.sep).length,
dir.split(path.sep).length - 1
)
.map(normalizeTitle)
.map(normalizeCategory);
Expand All @@ -99,9 +99,9 @@ let spinner: Ora;
}
}
algorithms[nName].implementations[language] = {
dir: path.join(...dir.split("/").slice(1)),
dir: path.join(...dir.split(path.sep).slice(1)),
url: `https://github.com/TheAlgorithms/${language}/tree/master/${path.join(
...dir.split("/").slice(1)
...dir.split(path.sep).slice(1)
)}`,
code: highlightCode(
(await fs.promises.readFile(dir)).toString(),
Expand Down

1 comment on commit 828ce98

@vercel
Copy link

@vercel vercel bot commented on 828ce98 May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.