Skip to content

Commit

Permalink
Merge pull request #985 from heroku/yarn-cache-replace-target
Browse files Browse the repository at this point in the history
Replace yarn cache rather than nest it
  • Loading branch information
joshwlewis authored Feb 16, 2022
2 parents 48d9595 + 4b057c5 commit 6c2109e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## main

- Fix issue with nested yarn caches and cache growth ([#985](https://github.com/heroku/heroku-buildpack-nodejs/pull/985))

## v191 (2022-02-14)
- Improve support for yarn 2+ installs ([#978](https://github.com/heroku/heroku-buildpack-nodejs/pull/978)

Expand Down
2 changes: 1 addition & 1 deletion lib/cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ save_default_cache_directories() {
if [[ $(features_get "cache-native-yarn-cache") == "true" ]] && [[ "$YARN" == "true" ]]; then
if [[ -d "$yarn_cache_dir" ]]; then
if [[ "$YARN_2" == "true" ]] && ! node_modules_enabled "$BUILD_DIR"; then
cp -R "$yarn_cache_dir" "$cache_dir/node/cache/yarn"
cp -RTf "$yarn_cache_dir" "$cache_dir/node/cache/yarn"
else
mv "$yarn_cache_dir" "$cache_dir/node/cache/yarn"
fi
Expand Down

0 comments on commit 6c2109e

Please sign in to comment.