Я не могу заставить NAnt прервать сборку, когда обнаружена ошибка.Вот одно из многих sqlcmd.exe казней:
<property name="test" value=""/>
<exec program="sqlcmd.exe" resultproperty="test" failonerror="true"
basedir="${sqlcmd.dir}" commandline="${commandline.script}" verbose="true">
<arg value="${filename}" />
<arg value="-v databaseName="${Database.Name}"" />
</exec>
<echo message="Result: ${test}"/>
Когда я нажимаю на этот шаг, я получаю ошибку из-за (в данном случае) пропущенной запятой.Вот вывод:
[exec] Starting 'C:\...\sqlcmd.exe (-E -S (local) -e -d "Core"
-i "C:\...\Associations.sql" -v databaseName="Core")'
in 'C:\...\Scripts'
[exec] <snip - lots of SQL>
[exec] Msg 102, Level 15, State 1, Server <snip>, Line 7
[exec] Incorrect syntax near 'CreatedDate'.
[exec] Msg 319, Level 15, State 1, Server <snip>, Line 11
[exec] Incorrect syntax near the keyword 'with'. If this
statement is a common table expression, an xmlnamespaces
clause or a change tracking context clause, the previous
statement must be terminated with a semicolon.
[echo] Result: 0
Довольно неприятная ошибка, и все же sqlcmd.exe , кажется, устанавливает код возврата равным 0.
Любые идеи, чтобы убедиться, что мой скриптпрерывается, когда я пропускаю запятую?