당신은 (당신의 정확한 요구, LS 실행에 조정할 뭔가를 할 수 있습니다) 현재 drectory에서 : 체크 있습니다 Bolek에 의해 게시 된 용액으로부터
<!-- Are there sql files in pending -->
<exec checkreturn="false" dir="${build.pendingsql}" command="ls *.sql" outputProperty="list"/>
<echo msg="${list}"/>
<if>
<equals arg1="${list}" arg2="ls: *.sql: No such file or directory" />
<then>
<echo msg="No SQL patches found"/>
</then>
<else>
<echo msg="SQL patches found"/>
</else>
</if>
의 주요 변경 사항 : 내 맥에
<?xml version="1.0" encoding="UTF-8"?>
<project name="test" default="check">
<target name="check">
<exec checkreturn="true" command="ls *.sql" outputProperty="list"/>
<if>
<equals arg1="${list}" arg2="" />
<then>
<echo msg="not found"/>
</then>
<else>
<echo msg="found ${list}"/>
</else>
</if>
</target>
</project>
불행히도 ls * .sql은 Mac에서 "> 0"을 반환하지 않으며 Mac에서는 더 이상 종료합니다. 그래도 많은 감사합니다, 당신은 나를 올바른 길로 가게했습니다 ... – AndrewD