Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Licence generateDisclaimer - Outputs "junk" to stdout #1191

Closed
eliihen opened this issue Oct 18, 2016 · 3 comments
Closed

Licence generateDisclaimer - Outputs "junk" to stdout #1191

eliihen opened this issue Oct 18, 2016 · 3 comments

Comments

@eliihen
Copy link

eliihen commented Oct 18, 2016

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When running yarn licenses generateDisclaimer and piping stdout to a file, I would expect to get only the disclaimer text to easily integrate this feature with CI etc. Instead, the first few lines look like this:

yarn licenses v0.15.1
info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE XXX PRODUCT.

The third line is correct, but the two proceeding have nothing to do with the disclaimer.

At the end of the document, there is a line that says

Done in 5.45s.

This is also not a part of the disclaimer and should not be a part of the output.

I see four possible solutions.

  • The first is to send all metadata about yarn to stderr
  • The second is to specially handle generateDisclaimer
  • The third is to create a global -q, --quiet flag
  • The last is to add a -o --output option to generateDisclaimer that writes a file

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create a package.json with some dependencies (preferably with some incompatible peerDependencies)
  2. Run yarn licenses generateDisclaimer > DISCLAIMERS.txt
  3. Open DISCLAIMERS.txt
  4. Look at the beginning and end of the document

What is the expected behavior?
The disclaimer file is generated without the parts preceding THE FOLLOWING SETS FORTH ATTRIBUTION, and without Done in 5.45s. at the end.

Please mention your node.js, yarn and operating system version.

$ yarn --version
0.15.1
$ node --version
v6.4.0
$ uname -a
Linux thor.osl.manamind.com 4.7.7-200.fc24.x86_64 #1 SMP Sat Oct 8 00:21:59 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
@tlent
Copy link

tlent commented Oct 27, 2016

I'd like to start contributing so I'm going to work on this.

tlent added a commit to tlent/yarn that referenced this issue Oct 27, 2016
Previously 'yarn licenses generate-disclaimer' would not include the
output wrapper header and footer but other valid variations such as
'yarn licenses generateDisclaimer' would.

Fixes yarnpkg#1191
@sebmck
Copy link
Contributor

sebmck commented Nov 1, 2016

Created #1586 to fix this, pending approval.

@sebmck sebmck closed this as completed Nov 1, 2016
@ariporad
Copy link

ariporad commented Apr 10, 2017

Hi All, I seem to still have this problem:

$ yarn --version
0.22.0
$ yarn licenses generate-disclaimer > test.out
warning my-project@1.0.0-beta.5: No license field
warning 7zip-bin-linux@1.0.3: The platform "darwin" is incompatible with this module.
warning 7zip-bin-win@2.0.2: The platform "darwin" is incompatible with this module.
warning package.json: No license field
$ head test.out
info "7zip-bin-linux@1.0.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info "7zip-bin-win@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE CASTBRIDGE PRODUCT.
...

Is there any way to fix this? Thanks!

NINJA EDIT: I can run yarn licenses generate-disclaimer --ignore-platform, and that does do what I want, but I don't think that's the intended use pattern. (I could be wrong)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants