Hello.
I'm trying to switch to AppVeyor for both Linux and Windows testing for a project f mine. So far everything is good minus one thing: I can't figure out how to conditionally set the npm cache folder so that it works cross-platform
cache:
- '%APPDATA%\npm-cache\ -> .appveyor.yml,package.json,package-lock.json' # need this only on Windows
- '$HOME/.npm -> .appveyor.yml,package.json,package-lock.json' # need this only on Linux
IMO this should be documented too.
Thanks in advance!

#1 Posted by Owen McDonnell Support staff on 09 Oct, 2018 03:18 PM
You can mix windows and linux paths in the same cache list and ones not relevant to the OS should be not found and therefore ignored.
#2 Posted by xhmikosr on 09 Oct, 2018 03:19 PM
Well, yeah that's what I'm doing. But there must be some proper way, without having the warning thrown.
#3 Posted by Owen McDonnell Support staff on 10 Oct, 2018 05:01 PM
Ok, if you want to avoid the warning then put the cache in a
for:construct. Like this,#4 Posted by xhmikosr on 15 Oct, 2018 07:41 AM
Thanks, this works.
Could it be documented though?
#5 Posted by Owen McDonnell Support staff on 16 Oct, 2018 10:28 PM
Specializing build matrix job config is documented here though
cache:is not explicitly mentioned.I think you have a point that it should be.
Our docs are open source and pull requests are welcome!
Owen McDonnell closed this discussion on 16 Oct, 2018 10:28 PM.
xhmikosr re-opened this discussion on 17 Oct, 2018 07:38 AM
#6 Posted by xhmikosr on 17 Oct, 2018 07:38 AM
Haha, I know they are open-source :) Just check the git log in the website repo.
But anyway, not sure how to phrase this thus the request.
#7 Posted by Ilya Finkelshte... on 17 Oct, 2018 04:29 PM
I would just add another YAML sample. Because we list settings which are ignored in
matrix.forconstruct, all other are respected.Ilya Finkelshteyn closed this discussion on 17 Dec, 2018 09:00 PM.