Skip to content

Commit

Permalink
fix replace() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahs committed Nov 23, 2020
1 parent 582287d commit e00500c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/content-migrations/update-developer-site-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand Down

0 comments on commit e00500c

Please sign in to comment.