Skip to content

Commit

Permalink
Fix edit links and copying commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Apr 5, 2022
1 parent 8f22eb1 commit 45489be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile.js
Expand Up @@ -622,12 +622,11 @@ target.gensite = function(prereleaseVersion) {

// 3. Copy docs folder to a temporary directory
echo("> Copying the docs folder (Step 3)");
docFiles.forEach(filePath => {
cp("-rf", `docs/src${filePath}*`, `${TEMP_DIR}/${filePath}`);
});
cp("-rf", "docs/src/*", TEMP_DIR);

// special case (for now)
cp("-f", "docs/src/pages/index.md", path.join(TEMP_DIR, "index.md"));
rm("-rf", path.join(TEMP_DIR, "pages"));

let versions = test("-f", "./versions.json") ? JSON.parse(cat("./versions.json")) : {};

Expand Down Expand Up @@ -660,7 +659,7 @@ target.gensite = function(prereleaseVersion) {
sourceBaseName = `${path.basename(filename, ".md")}.js`,
sourcePath = path.join("lib/rules", sourceBaseName),
ruleName = path.basename(filename, ".md"),
filePath = path.join("docs", path.relative("tmp", filename));
filePath = path.posix.join("docs", path.relative("tmp", filename));
let text = cat(filename),
ruleType = "",
title;
Expand Down Expand Up @@ -702,7 +701,7 @@ target.gensite = function(prereleaseVersion) {
"---",
`title: ${title}`,
"layout: doc",
`edit_link: https://github.com/eslint/eslint/edit/main/${filePath}`,
`edit_link: https://github.com/eslint/eslint/edit/main/${filePath.replace("docs/", "docs/src/")}`,
ruleType,
"---",
"<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->",
Expand Down

0 comments on commit 45489be

Please sign in to comment.