我正在玩 Ammonite ops,并且想在几个 git 存储库上自动执行“git pull”。我无法弄清楚如何更改到该特定目录(我想在其中执行 git pull),因为文档说 -
there are no in-built operations to change the
cwd
. In general you should not need to: simply defining a new path, e.g. val target = cwd/'target Should be sufficient for most needs.
虽然上面也提到了解决方案,但是我并没有达到预期的效果。
最佳答案
只需创建一个隐式 Path 变量,该变量将用作当前目录。
示例:
implicit val currentDir = home/'mydir
此目录将用于将来的 %
和 %%
调用。
或者,您可以在每次调用中提供当前目录。
关于scala - 如何使用 Ammonite Ops 更改到某个目录并在其中执行操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37547319/