3

我正在使用 Guard 自动监视目录并使用 Guard-Shell 执行一些 bash 脚本,问题是我将 Guardfile 放在与正在监视的文件夹不同的文件夹中,所以我必须使用guard -w /directory/being/watched.

我的问题是,是否有一个可以从 Guardfile 访问的变量来告诉我正在监视的目录?

谢谢。

4

1 回答 1

0

根据这个:

https://github.com/guard/guard/wiki/Correctly-using-the---watchdir-option

解决方案是在被监视的目录中运行 Guard,但在不同的目录中指定 Guardfile:

cd /directory/being/watched
BUNDLE_GEMFILE=/projects/foo/Gemfile bundle exec guard -G /projects/foo/Guardfile
于 2015-09-13T11:59:20.607 回答