1

我制作了一个 bash 脚本来重建我的 satis 存储库。我想添加一些日志记录,因为该命令将自动运行。

当我执行

output="$(php -f vendor/bin/satis build \
  --repository-url git@bitbucket.org:example/gibberish.git satis.json web/ -n)"

$output 应该是

[InvalidArgumentException] 指定的存储库 url “git@bitbucket.org:example/gibberish.git”不存在。

构建 [--repository-url [REPOSITORY-URL]] [--no-html-output] [--skip-errors] [--stats] [--] [] [] []...

但是,我只得到Scanning packages 如何在 Bash 中捕获 PHP 脚本引发的异常?

4

0 回答 0