gpt4 book ai didi

bash - 如何通过 ionic 平台命令通过 Yes 来提示

转载 作者:行者123 更新时间:2023-12-02 19:21:01 26 4
gpt4 key购买 nike

我的 shell 脚本中有以下命令。

ionic cordova platform add browser

提示我输入“Y”,如下所示:

? Are you sure you want to continue? (Y/n)

我希望使其成为非交互式,因此我尝试使用以下内容传递Yes:

echo Y | ionic cordova platform add browser

Yes | ionic cordova platform add browser

ionic cordova platform add browser << 'Y'

同上;该命令以非交互方式执行,但接受 No 而不是 Yes,如下所示:

[WARN] About to add the browser platform to your app.

The browser Cordova platform is not recommended for production use.

Instead, we recommend using platform detection and browser APIs to target web/PWA. See the Cross Platform docs[1]
for details.

Alternatively, ⚡️ Capacitor ⚡️ (https://ion.link/capacitor), Ionic's official native runtime, fully supports
traditional web and Progressive Web Apps. See the Capacitor docs[2] to learn how easy it is to migrate.

[1]: https://ion.link/cross-platform-docs
[2]: https://ion.link/capacitor-cordova-migration-docs

--no-confirm: Are you sure you want to continue? No

您能否建议如何自动输入并使命令非交互式?

最佳答案

--confirm:开启确认提示的自动确认--no-interactive:关闭交互式提示和精美输出。

--confirm 应自动接受提示

正如您在评论中指出的那样,这应该允许确认提示并具有非交互模式

ionic cordova platform add browser --confirm --no-interactive

关于bash - 如何通过 ionic 平台命令通过 Yes 来提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63062004/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com