From e00500cf72658db8a1fcbfcb6b5082f73954c7c1 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Mon, 23 Nov 2020 11:57:52 -0500 Subject: [PATCH] fix replace() bug --- script/content-migrations/update-developer-site-links.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/content-migrations/update-developer-site-links.js b/script/content-migrations/update-developer-site-links.js index 3e1805cfdb5f..8cf00e02f6fd 100755 --- a/script/content-migrations/update-developer-site-links.js +++ b/script/content-migrations/update-developer-site-links.js @@ -60,11 +60,11 @@ async function main () { ? redirect + '#' + fragment : redirect - // first remove any trailing slashes from the old link, - // then replace with the new link + // first replace the old link with the new link + // then remove any trailing slashes newContent = newContent - .replace(`${devLink}/`, devLink) .replace(devLink, newLink) + .replace(`${newLink}/`, newLink) } fs.writeFileSync(file, frontmatter.stringify(newContent, data, { lineWidth: 10000 }))