Skip to content

Commit

Permalink
Persist cache (#1537)
Browse files Browse the repository at this point in the history
* Persist cache

* Add persistent global bin to yarn
  • Loading branch information
ekoeryanto authored and r15ch13 committed Jun 1, 2017
1 parent 5a5cbe1 commit e4cc2c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bucket/yarn.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@
},
"url": "https://yarnpkg.com/downloads/0.24.6/yarn-0.24.6.msi",
"hash": "00f1aab358abe90eaaeb66c31fdf7342822dfba96a781e6995ffb0d4c68ad330",
"env_add_path": "Yarn\\bin",
"persist": [
"cache",
"bin"
],
"post_install": "
yarn config set cache \"$persist_dir\\cache\"
yarn config set prefix \"$persist_dir\\bin\"
",
"env_add_path": [
"bin",
"Yarn\\bin"
],
"checkver": {
"url": "https://yarnpkg.com/latest-version",
"re": "([\\d.]+)"
Expand Down

4 comments on commit e4cc2c3

@wadetb
Copy link

@wadetb wadetb commented on e4cc2c3 Jun 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. Looks like it should be yarn config set cache-folder, vs yarn config set cache. See https://yarnpkg.com/en/docs/cli/cache.

@r15ch13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks πŸ‘ fixed with f16311a

@wadetb
Copy link

@wadetb wadetb commented on e4cc2c3 Jun 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! It is working better, but there is still some kind of issue:

scoop install yarn
yarn global add polymer-cli
polymer

The result is unable to find polymer. It appears to be a missing ..\ in the polymer.cmd that gets generated, but I'm not sure how. Also, a lot of files are still installed by Yarn into %APPDATA%. I'm going back to the Windows NodeJS installer + NPM for the time being.

@r15ch13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should revert theses changes. Yarn keeps adding stuff to %APPDATA% anyway, so there is no real benefit for adding persistence to bin and cache.
Your polymer.cmd problem seems related to yarnpkg/yarn#2224
If I install polymer it results in this @"%~dp0\C:\Users\r15ch13\AppData\Local\Yarn\config\global\node_modules\.bin\polymer.cmd".
%~dp0 resolves to the current directory...

Please sign in to comment.