tag:help.appveyor.com,2012-11-13:/discussions/problems/2410-problem-with-command-that-runs-on-my-local-machine-fineAppVeyor: Discussion 2018-10-19T08:17:17Ztag:help.appveyor.com,2012-11-13:Comment/372666342015-07-01T00:32:52Z2015-07-01T00:54:17ZProblem using the find command to search through commit messages<div><p>I am attempting to set a flag to publish binaries based on the
presence of the string "[publish binary]" in the commit message.
When I run the following code on my local machine in a command
prompt it works, for some reason when run on appveyor it doesn't,
and I don't understand why.</p>
<pre>
<code>> (echo %APPVEYOR_REPO_COMMIT_MESSAGE% | find "[publish binary]" > nul) && (set PUBLISH_BINARY=true) || (ver > nul)
> echo APPVEYOR_REPO_COMMIT_MESSAGE=%APPVEYOR_REPO_COMMIT_MESSAGE%
APPVEYOR_REPO_COMMIT_MESSAGE=debug commit message [publish binary]
> echo PUBLISH_BINARY=%PUBLISH_BINARY%
PUBLISH_BINARY=false</code>
</pre>
<p>What I am expecting is for <code>PUBLISH_BINARY=true</code>. It
really seems like the "find" app is not working as expected, though
that is a pretty basic windows utility. Can anyone help me with
this? What am I doing wrong?</p>
<p>My project is <code>EvolveLabs/electron-weak</code>, you should
be able to see my script in there.</p></div>justintag:help.appveyor.com,2012-11-13:Comment/372666342015-07-01T00:46:57Z2015-07-01T00:46:57ZProblem using the find command to search through commit messages<div><p>Actually if I remove the <code>> nul</code> after find, then
I get this error: <code>FIND: Parameter format not
correct</code></p>
<p>I'm not sure how that's possible. I'm using it as <code>find
"[publish binary]"</code> it doesn't get much simpler than that. Is
there some kind of escaping I need to do or something? Again, this
exact line of code works for me on windows 8.1.</p></div>justintag:help.appveyor.com,2012-11-13:Comment/372666342015-07-01T01:07:59Z2015-07-01T01:07:59ZProblem using the find command to search through commit messages<div><p>I'd try using PowerShell for that:</p>
<pre>
<code>- ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.contains('[publish binary]')) { $env:PUBLISH_BINARY = 'true' } else { $env:PUBLISH_BINARY = 'false' }</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/372666342015-07-01T02:09:33Z2015-07-01T02:09:33ZProblem using the find command to search through commit messages<div><p>That did it :)</p>
<p>I don't understand why the other way didn't work but I'm
unblocked. Thanks.</p></div>justin