【问题标题】:concurrently handle input does not work as expected同时处理输入不能按预期工作
【发布时间】:2022-08-24 02:19:56
【问题描述】:

我正在尝试将两个 shell 命令与concurrently lib 结合起来,并且应该有将用户输入转发到其中一个子进程的选项,请参阅docs here--handle-input 部分。但它在我的情况下不起作用: npm 脚本

    \"test:unit\": \"concurrently --kill-others --handle-input --names test,build \\\"vitest --environment jsdom\\\" \\\"vite build --watch\\\"\",

结果是

[test]      Tests  1 failed | 12 passed (13)
[test]       Time  94ms
[test] 
[test] 
[test]  FAIL  Tests failed. Watching for file changes...
[test]        press u to update snapshot, press h to show help

当我单独运行它时,我正在按“u”,但没有任何反应,即使我试图通过输入键确认。

所以也许我对 lib 的理解有误,或者其他什么。如何将我的击键传递给子进程“测试”?

谢谢你的任何建议。

标签: npm-scripts concurrently


【解决方案1】:

我在提到的github issue 中得到帮助。信用Mr. Pascal Jufer

使用--raw 选项就可以了!

所以我的最终脚本是:

"test:unit": "concurrently --raw --kill-others --handle-input --names test,build \"vitest --environment jsdom\" \"vite build --watch\"",

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-15
    • 2015-06-26
    • 2013-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多