config: Fix Netlify default cache dir logic

Fixes #8710
This commit is contained in:
Bjørn Erik Pedersen 2021-06-29 09:51:09 +02:00
parent 49fedbc51c
commit 6c8c0c8b6a
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -412,8 +412,8 @@ func getCacheDir(cfg config.Provider) string {
return addTrailingFileSeparator(cacheDir) return addTrailingFileSeparator(cacheDir)
} }
// Both of these are fairly distinctive OS env keys used by Netlify. // This is always set to true when running on Netlify.
if os.Getenv("DEPLOY_PRIME_URL") != "" && os.Getenv("PULL_REQUEST") != "" { if os.Getenv("NETLIFY") == "true" {
// 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