Feature request: corollary to `sh` that captures stdout

未关闭
#678 241 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
28/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
ruby
领域
build-system

调研方向

首先检查 Rake 现有的 sh 入口点,以及关于捕获 stderr 和 stdout 的 issue 讨论。确定预期的 API,以及它应如何保留 sh 的 verbose 和 noop 能力;只有确定了行为并完成相应的实现和测试,任务才算完成。

由索引模型根据 Issue 内容生成。

描述

It seems a common occurrence for me to have custom tasks that need to invoke a shell command, and capture the output.

The "simple" solution is to use backticks or %x to capture the command's stderr/stdout. However, using that isn't safe or recommended. Further, it loses all the helpful verbose and noop capabities that rake's own sh provides.

What do others do in this situation? Would it be helpful to have a version of sh that captures stderr and stdout? (Or to upgrade sh such that the resulting response object has stderr and stdout?)

Any other alternatives I'm missing?

主要语言
Ruby
星标
2.5k
派生
650
平均合并
6 分钟
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ruby/rake 的其他 Issue

查看 ruby/rake 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。