geeklearningio / gl-vsts-tasks-yarn

Yarn Package Manager Visual Studio Team Services Build and Release Management extensions
MIT License
52 stars 18 forks source link

Command not found providing arguments other than install #2

Closed cvanleeuwen closed 7 years ago

cvanleeuwen commented 7 years ago

Great work on setting up this task!

I've setup installing my dependencies through yarn on VSTS. I got this working through VSTS command line tasks (e.g. npm install yarn@0.18.0 -g).

Switching to the yarn task fails, all settings are defaults and arguments is set to: install --pure-lockfile. Also configuring with licenses generate-disclaimer will fail the build:

2016-12-28T15:32:08.7826630Z ##[section]Starting: Yarn licenses generate-disclaimer 2016-12-28T15:32:08.7836632Z ============================================================================== 2016-12-28T15:32:08.7836632Z Task : Yarn task 2016-12-28T15:32:08.7836632Z Description : Executes Yarn 2016-12-28T15:32:08.7836632Z Version : 0.2.2001 2016-12-28T15:32:08.7836632Z Author : Geek Learning 2016-12-28T15:32:08.7836632Z Help : [More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version 0.2.2001) 2016-12-28T15:32:08.7836632Z ============================================================================== 2016-12-28T15:32:16.2956023Z [command]C:\a\yarn\dist\bin\yarn.cmd licenses generate-disclaimer 2016-12-28T15:32:16.7386021Z yarn licenses generate-disclaimer v0.18.0 2016-12-28T15:32:16.8396050Z error Command "licenses generate-disclaimer" not found. 2016-12-28T15:32:16.8626098Z Error: C:\a\yarn\dist\bin\yarn.cmd failed with return code: 1 2016-12-28T15:32:16.8736037Z ##[error]Error: C:\a\yarn\dist\bin\yarn.cmd failed with return code: 1 2016-12-28T15:32:16.8796028Z ##[section]Finishing: Yarn licenses generate-disclaimer

Just using install as argument does work as expectd.

Does the task support yarn's other CLI arguments? Am I configuring it incorrectly?

sandorfr commented 7 years ago

Sounds like a bug, I don't really see the root cause but I'll sure try to fix this :).

sandorfr commented 7 years ago

Quick follow up, I don't see any obvious bug. This is really weird :(

cvanleeuwen commented 7 years ago

Are you able to reproduce it on VSTS?

I found out configuring with check and install (without additional arguments) does work as expected.

I think the issue isn't in yarn, but in the vsts task. Calling the yarn cli with invalid arguments reports it like this:

C:\code\sample [master ≡]> yarn foo
yarn foo v0.18.1
error Command "foo" not found.
C:\code\sample [master ≡]> yarn foo bar
yarn foo v0.18.1
error Command "foo" not found.

So that might mean the arguments passed to vsts-task-lib/task might be off? I couldn't find any API docs on it though... Do you have any idea where the docs/code are?

sandorfr commented 7 years ago

Everything should work as desired with latest release.

cvanleeuwen commented 7 years ago

🎉 Confirmed! Thanks for fixing!