Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatsby-plugin-netlify tweaks #2191

Merged
merged 3 commits into from
Sep 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Bikeshedding code arrangement
  • Loading branch information
bvaughn committed Sep 21, 2017
commit 9ba3cbbe30e6c9269491318b627a264d60750130
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-netlify/src/create-redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default async function writeRedirectsFile(pluginData, redirects) {
return `${redirect.fromPath} ${redirect.toPath} ${status}`
})

const data = `${HEADER_COMMENT}\n\n${redirects.join(`\n`)}`

let appendToFile = false

// Websites may also have statically defined redirects
Expand All @@ -29,6 +27,8 @@ export default async function writeRedirectsFile(pluginData, redirects) {
}
}

const data = `${HEADER_COMMENT}\n\n${redirects.join(`\n`)}`

return appendToFile
? appendFile(FILE_PATH, `\n\n${data}`)
: writeFile(FILE_PATH, data)
Expand Down