yarn icon indicating copy to clipboard operation
yarn copied to clipboard

`yarn config set cache-folder` should be relative to the current working directory

Open zakhenry opened this issue 5 years ago • 2 comments

Bug description

The current behavior of yarn config set cache-folder [dir] does not act as expected - when you declare the dir arg, is is not treated as a relative dir like most unix unix commands do, rather it is added to a shared dir. This can be circumvented by prefixing $(pwd).

Command

cd /
yarn config set cache-folder .yarn-cache

What is the current behavior?

Cache folder is set to /usr/local/share/.yarn-cache

What is the expected behavior?

Cache folder is set to /.yarn-cache/v6

Steps to Reproduce

➜ docker run -it node:alpine sh
/ # yarn config set cache-folder .yarn-cache
yarn config v1.22.4
success Set "cache-folder" to ".yarn-cache".
Done in 0.04s.
/ # yarn cache dir
/usr/local/share/.yarn-cache/v6
/ # yarn config set cache-folder $(pwd)/.yarn-cache
yarn config v1.22.4
success Set "cache-folder" to "//.yarn-cache".
Done in 0.05s.
/ # yarn cache dir
/.yarn-cache/v6

Environment

  • Node Version: v14.4.0
  • Yarn v1 Version: 1.22.4
  • OS and version: (docker) node:alpine 3.11.6

zakhenry avatar Jun 25 '20 09:06 zakhenry

Just stumbled upon this problem, would really like a fix, or at least a full path in log when saying success Set "cache-folder" to XXX

bcouetil avatar May 13 '22 15:05 bcouetil