Gradle执行命令带引号

时间:2019-01-28 12:21:51

标签: git gradle android-gradle

我想从过去24小时内在git上完成的提交中获取提交消息。因此,我在Gradle中尝试了以下命令:

  def lastCommit = 'git rev-list -n1 --before="24 hours" --first-parent origin/develop'.execute()

捕捉我范围内的最后一次提交。但是我收到以下错误:

* What went wrong:
A problem occurred evaluating project ':app'.
> fatal: ambiguous argument 'hours"': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'

我无法找到gradle正确处理“ 24小时”参数并在不中断执行的情况下转义引号的方法。

0 个答案:

没有答案
相关问题