From 45489be5c6a7aee3734392c48179bc891858eb32 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Tue, 5 Apr 2022 09:44:07 -0700 Subject: [PATCH] Fix edit links and copying commands --- Makefile.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile.js b/Makefile.js index c03ed22b25fd..25eb619fdc1d 100644 --- a/Makefile.js +++ b/Makefile.js @@ -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")) : {}; @@ -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; @@ -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, "---", "",