Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
squash! Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchabran authored and actions-user committed Jun 20, 2024
1 parent e131edb commit 34b76ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/scripts/generate-redirects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import redirects from './redirects.mjs'

const foo = await redirects()

const redirectLines = (await redirects()).map((entry) => `${entry.source} ${entry.destination}${entry.force ? ' 302!' : ''}`).join('\n')
const redirectLines = (await redirects())
.map(entry => `${entry.source} ${entry.destination}${entry.force ? ' 302!' : ''}`)
.join('\n')
const lines = `\n# Generated by generate-redirects.mjs from Git history\n${redirectLines}\n`

console.log('Redirects:\n', lines)
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/redirects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async function readNotionMigrationRedirects() {
// To go around that, we add a new field 'force' that the script that
// generate the final _redirects file used by Netlify uses to append
// 301! on that entry, effectively forcing the redirection.
for ( let entry of data.redirections ) {
entry["force"] = true
for (let entry of data.redirections) {
entry['force'] = true
}
return data
}
Expand Down

0 comments on commit 34b76ef

Please sign in to comment.