unset files;
git --no-pager diff --name-only HEAD HEAD~10 -- '*.php' |
while IFS= read -r filename; do
if [[ -f $filename ]]; then
files+="./$filename,"
fi
done
files="${files%,}" | phpmd "$files" text codesize
这在命令行中完美运行。但后来我在Ant构建脚本中定义它,如下所示:
<target name="phpmd"
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="bash" failonerror="true" >
<arg value="-c" />
<arg value="unset files; git --no-pager diff --name-only HEAD HEAD~10 -- '*.php' | while IFS= read -r filename; do if [[ -f $$filename ]]; then files+="./$$filename,"; fi; done; files="$${files%,}" | phpmd "$$files" text codesize" />
</exec>
</target>
它不起作用......也许有人会知道这个问题是什么?
答案 0 :(得分:0)
你是否尝试过使用而不仅仅是为了一个不仅仅是一个争论的东西。
例如:
<arg line="unset files; git --no-pager diff --name-only HEAD HEAD~10 -- '*.php' | while IFS= read -r filename; do if [[ -f $$filename ]]; then files+="./$$filename,"; fi; done; files="$${files%,}" | phpmd "$$files" text codesize" />