(url)
| 79 | } |
| 80 | |
| 81 | function purge(url) { |
| 82 | getLanguageVariants(url).forEach((localizedUrl) => { |
| 83 | if (dryRun) { |
| 84 | console.log(`This is a dry run! Will purge cache for ${localizedUrl}`) |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | console.log(`Purging cache for ${localizedUrl}`) |
| 89 | const result = execSync(`${purgeCommand} ${localizedUrl}`).toString() |
| 90 | logStatus(result) |
| 91 | |
| 92 | // purge twice to ensure referenced content on the page is updated too |
| 93 | const secondResult = execSync(`${purgeCommand} ${localizedUrl}`).toString() |
| 94 | logStatus(secondResult) |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | function getLanguageVariants(url) { |
| 99 | // for https://docs.github.com/en/foo, get https://docs.github.com/foo |
no test coverage detected