Yarn: 许可证 generateDisclaimer - 将“垃圾”输出到标准输出

创建于 2016-10-18  ·  3评论  ·  资料来源: yarnpkg/yarn

你想请求一个_feature_还是报告一个_bug_?
漏洞

当前的行为是什么?
当运行yarn licenses generateDisclaimer并将标准输出传输到文件时,我希望只获得免责声明文本,以便轻松将此功能与 CI 等集成。相反,前几行如下所示:

yarn licenses v0.15.1
info "[email protected]" 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.

第三行是正确的,但两个程序与免责声明无关。

在文件的末尾,有一行说

Done in 5.45s.

这也不是免责声明的一部分,也不应该是输出的一部分。

我看到了四种可能的解决方案。

  • 第一个是将所有关于yarn的元数据发送到stderr
  • 二是专门处理generateDisclaimer
  • 三是创建全局-q, --quiet标志
  • 最后是在写入文件的generateDisclaimer中添加-o --output选项

如果当前行为是错误,请提供重现的步骤。

  1. 创建一个带有一些依赖项的 package.json(最好带有一些不兼容的 peerDependencies)
  2. 运行yarn licenses generateDisclaimer > DISCLAIMERS.txt
  3. 打开DISCLAIMERS.txt
  4. 查看文档的开头和结尾

预期的行为是什么?
免责声明文件的生成没有THE FOLLOWING SETS FORTH ATTRIBUTION前面的部分,并且末尾没有Done in 5.45s.

请提及您的 node.js、yarn 和操作系统版本。

$ 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
cat-feature

最有用的评论

大家好,我似乎仍然有这个问题:

$ yarn --version
0.22.0
$ yarn licenses generate-disclaimer > test.out
warning [email protected]: No license field
warning [email protected]: The platform "darwin" is incompatible with this module.
warning [email protected]: The platform "darwin" is incompatible with this module.
warning package.json: No license field
$ head test.out
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info "[email protected]" 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.
...

有没有什么办法解决这一问题? 谢谢!

NINJA 编辑:我可以运行yarn licenses generate-disclaimer --ignore-platform ,这确实可以满足我的要求,但我认为这不是预期的使用模式。 (我可能是错的)

所有3条评论

我想开始做出贡献,所以我将致力于此。

创建#1586 来解决这个问题,等待批准。

大家好,我似乎仍然有这个问题:

$ yarn --version
0.22.0
$ yarn licenses generate-disclaimer > test.out
warning [email protected]: No license field
warning [email protected]: The platform "darwin" is incompatible with this module.
warning [email protected]: The platform "darwin" is incompatible with this module.
warning package.json: No license field
$ head test.out
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info "[email protected]" 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.
...

有没有什么办法解决这一问题? 谢谢!

NINJA 编辑:我可以运行yarn licenses generate-disclaimer --ignore-platform ,这确实可以满足我的要求,但我认为这不是预期的使用模式。 (我可能是错的)

此页面是否有帮助?
0 / 5 - 0 等级