Skip to content

Commit

Permalink
docs: fix rules folder (#1231)
Browse files Browse the repository at this point in the history
* docs: fix rules folder

* docs: fix fetchData to always use location
  • Loading branch information
elsapet authored Aug 30, 2023
1 parent fb3c15d commit f13e708
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/_data/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const yaml = require("js-yaml");
const cweList = require("./cweList.json");
const gitly = require("gitly");
const source = "bearer/bearer-rules";
const rulesPath = "_tmp/rules-data/rules";
const rulesPath = "_tmp/rules-data";
const excludeDirectories = [".github", "scripts"];

let counts = {
Expand Down Expand Up @@ -78,7 +78,7 @@ async function fetchData(location) {
const dirs = await readdir(location);
// ex: looping through rules [ruby, gitleaks, sql]
dirs.forEach(async (dir) => {
const dirPath = path.join(rulesPath, dir);
const dirPath = path.join(location, dir);
if (isDirectory(dirPath) && !excludeDirectories.includes(dir)) {
const subDirs = await readdir(dirPath);
updateCounts(dir);
Expand Down Expand Up @@ -143,5 +143,5 @@ async function fetchFile(location, breadcrumb) {

module.exports = async function () {
await fetchRelease();
return await fetchData(rulesPath);
return await fetchData(path.join(rulesPath, "rules"));
};

0 comments on commit f13e708

Please sign in to comment.