title: "When /^I (run|try) ([^]+)` from '([^\s]+)'$/"
post_status: publish
comment_status: open
taxonomy:
category:
- wp-cli-handbook
post_tag:
- Behat Steps
- Repos
- Data
When /^I (run|try) ([^]+)` from '([^\s]+)'$/
在子目录中运行或尝试执行给定的命令。
用法
run 期望退出码为 0,而 try 允许非零退出码。
Scenario: 我的示例场景
When I run `wp core is-installed`
Then STDOUT should be empty
When I run `wp core is-installed` from 'foo/wp-content'
Then STDOUT should be empty
Behat 步骤文档在每次发布时从 WP-CLI 代码库生成。如需改进,请提交一个拉取请求。
相关
- When /^I launch in the background `([^`]+)`$/ - 在后台启动给定的命令。
- When /^I (run|try) `([^`]+)`$/ - 运行或尝试执行给定的命令。
- When /^I (run|try) the previous command again$/ - 再次运行或尝试执行之前的命令。