Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

--root command line argument doesn't parse path correctly #106

Open
LachlanStuart opened this issue Aug 7, 2018 · 2 comments
Open

--root command line argument doesn't parse path correctly #106

LachlanStuart opened this issue Aug 7, 2018 · 2 comments

Comments

@LachlanStuart
Copy link

--root and -p are documented to be the same option:

$ codecov --help

...
--root, -p
Project root, if not current directory
...

But according to the logs, only one of the two works as expected. See the "Upload Coverage" step in each of these links:

  • codecov -p .. -F webapp works as expected
  • codecov --root ../.. -F webapp fails to upload due to a JavaScript error. It looks like it's incorrectly parsing the arguments, because it mentions the path '/root/metaspace/metaspace/webapp/true'. /root/metaspace is the project root, /root/metaspace/metaspace/webapp is the current directory, but there is no true directory anywhere in that directory tree. It's as if something coerced the --root argument to a boolean before it was used.

I'm on version 3.0.4, installed through NPM and run on CircleCI without any codecov.yaml file.

@eddiemoore
Copy link
Collaborator

I notice with the -p it's just using the path as .., but with the --root it's using ../.. just wondering if that could be why.
May need to put the root in quotes. codecov --root "../.." -F webapp

Let me know if that helps

@LachlanStuart
Copy link
Author

.. was a typo in my GitHub comment, I used ../.. in the linked logs. Even if I use a subdirectory (e.g. codecov --root src I got the same issue. Quotes did nothing. However I found that adding a = worked, e.g. codecov --root=src.

I think this might be a misconfiguration of yargs that has caused it to interpret --root as a boolean flag instead of expecting it to be followed with a value. I don't have any experience with yargs, but noticed that their docs don't list 'path' as a valid value for type, which may explain this behavior.

@thomasrockhu thomasrockhu self-assigned this Nov 29, 2020
@thomasrockhu thomasrockhu removed their assignment Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants