Yarn: `yarn cache clean` removes the whole directory

Created on 14 Apr 2017  路  1Comment  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Today I did yarn config set cache-folder $PWD and then yarn cache clean and then all of the contents of my repo got deleted, which I know that is the intended behavior, but it was really scary.

I was expecting only something like pwd/v1/ or pwd/.yarn-cache/v1 to get deleted, instead of all of it.

This is a bit scary because if I do something like yarn config set cache-folder ~/ and then yarn cache clean, then all of my home dir would get removed right?

If the current behavior is a bug, please provide the steps to reproduce.
yarn config set cache-folder $PWD and then yarn cache clean

What is the expected behavior?

Only clear the v1 folder inside the cache dir

Please mention your node.js, yarn and operating system version.

Most helpful comment

One does not ask for a tree, and complain about the forest.................

>All comments

One does not ask for a tree, and complain about the forest.................

Was this page helpful?
0 / 5 - 0 ratings