Skip to content

Commit e00500c

Browse files
committed
fix replace() bug
1 parent 582287d commit e00500c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

script/content-migrations/update-developer-site-links.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ async function main () {
6060
? redirect + '#' + fragment
6161
: redirect
6262

63-
// first remove any trailing slashes from the old link,
64-
// then replace with the new link
63+
// first replace the old link with the new link
64+
// then remove any trailing slashes
6565
newContent = newContent
66-
.replace(`${devLink}/`, devLink)
6766
.replace(devLink, newLink)
67+
.replace(`${newLink}/`, newLink)
6868
}
6969

7070
fs.writeFileSync(file, frontmatter.stringify(newContent, data, { lineWidth: 10000 }))

0 commit comments

Comments
 (0)