mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-28 21:11:44 -05:00
Fix Cloudflare vs Netlify cache dir issue
Re-add the additional environment checks to determine if its Netlify. Seems that Cloudflare also sets `NETLIFY=true`. This makes it look, basically, like a variant of the conditional we had before we started fixing this, but I have checked this logic on Netlify now and it should work. Fixes #8714
This commit is contained in:
parent
34e4742f0c
commit
4c8552b114
1 changed files with 4 additions and 2 deletions
|
@ -412,8 +412,10 @@ func getCacheDir(cfg config.Provider) string {
|
||||||
return addTrailingFileSeparator(cacheDir)
|
return addTrailingFileSeparator(cacheDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is always set to true when running on Netlify.
|
// See Issue #8714.
|
||||||
if os.Getenv("NETLIFY") == "true" {
|
// Turns out that Cloudflare also sets NETLIFY=true in its build environment,
|
||||||
|
// but all of these 3 should not give any false positives.
|
||||||
|
if os.Getenv("NETLIFY") == "true" && os.Getenv("PULL_REQUEST") != "" && os.Getenv("DEPLOY_PRIME_URL") != "" {
|
||||||
// Netlify's cache behaviour is not documented, the currently best example
|
// Netlify's cache behaviour is not documented, the currently best example
|
||||||
// is this project:
|
// is this project:
|
||||||
// https://github.com/philhawksworth/content-shards/blob/master/gulpfile.js
|
// https://github.com/philhawksworth/content-shards/blob/master/gulpfile.js
|
||||||
|
|
Loading…
Reference in a new issue