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
1 changed files with 2 additions and 2 deletions

View File

@ -412,8 +412,8 @@ func getCacheDir(cfg config.Provider) string {
return addTrailingFileSeparator(cacheDir)
}
// Both of these are fairly distinctive OS env keys used by Netlify.
if os.Getenv("DEPLOY_PRIME_URL") != "" && os.Getenv("PULL_REQUEST") != "" {
// This is always set to true when running on Netlify.
if os.Getenv("NETLIFY") == "true" {
// Netlify's cache behaviour is not documented, the currently best example
// is this project:
// https://github.com/philhawksworth/content-shards/blob/master/gulpfile.js