MCPcopy Index your code
hub / github.com/github/docs / purge

Function purge

script/purge-fastly-by-url.js:81–96  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

79}
80
81function 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
98function getLanguageVariants(url) {
99 // for https://docs.github.com/en/foo, get https://docs.github.com/foo

Callers 1

Calls 2

getLanguageVariantsFunction · 0.85
logStatusFunction · 0.85

Tested by

no test coverage detected