mirror of
https://github.com/BillyOutlast/posthog.com.git
synced 2026-02-04 03:11:21 +01:00
Redirect fix (#1978)
* rename titles -> startup-job-titles * rename back * Redirect check fix * Add recent missing redirect * Rename back * Correct redirect * adding log when no path changes found
This commit is contained in:
@@ -24,6 +24,7 @@ const redirectText = (from, to) => {
|
||||
|
||||
const redirectWithDateCommentText = (date, redirect) => {
|
||||
return `
|
||||
|
||||
# Added: ${formatDate(date)}${redirect}`
|
||||
}
|
||||
|
||||
@@ -111,9 +112,10 @@ const getRedirects = async ({ gitDiff, localConfig, remoteConfig, debug = false
|
||||
log('Not including redirect', redirect)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log('No path changes found')
|
||||
}
|
||||
|
||||
log(newRedirects)
|
||||
return newRedirects
|
||||
}
|
||||
|
||||
@@ -123,10 +125,12 @@ const main = async () => {
|
||||
|
||||
const remoteConfig = await getRemoteConfig()
|
||||
const localConfig = await getLocalConfig()
|
||||
const redirects = getRedirects({ gitDiff, localConfig, remoteConfig })
|
||||
const debug = process.env.DEBUG
|
||||
const redirects = await getRedirects({ gitDiff, localConfig, remoteConfig, debug })
|
||||
|
||||
if (redirects.length > 0) {
|
||||
appendToLocalConfig(redirects.join(''))
|
||||
log('Writing', redirects)
|
||||
await appendToLocalConfig(redirects.join(''))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
Reference in New Issue
Block a user