Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NAnt: cannot resolve to boolean value

<if test="${deployErrors} &gt; 0">
   <fail message="MSDeploy failed" />
</if>

${deployErrors} is populated from a regex capture group and either has a numeric value or empty string. How can I check if this is greater than 0 in a NAnt if block? Here's the error I'm getting if deploy errors contains '1'

'1 > 0' is not a valid value for attribute 'test' of . Cannot resolve '1 > 0' to boolean value. String was not recognized as a valid Boolean.

like image 339
Rob Stevenson-Leggett Avatar asked May 05 '11 09:05

Rob Stevenson-Leggett


1 Answers

I've not tried it, but I think you need the whole of your expression within the curly braces:

<if test="${deployErrors > 0}">

See also the second example in the documentation page.

Update from OP:

This worked:

<if test="${deployErrors != ''}">
like image 196
robaker Avatar answered Oct 04 '22 01:10

robaker