Problem using the find command to search through commit messages
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.
> (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
What I am expecting is for PUBLISH_BINARY=true. 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?
My project is EvolveLabs/electron-weak, you should
be able to see my script in there.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

1 Posted by justin on 01 Jul, 2015 12:46 AM
Actually if I remove the
> nulafter find, then I get this error:FIND: Parameter format not correctI'm not sure how that's possible. I'm using it as
find "[publish binary]"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.Support Staff 2 Posted by Feodor Fitsner on 01 Jul, 2015 01:07 AM
I'd try using PowerShell for that:
3 Posted by justin on 01 Jul, 2015 02:09 AM
That did it :)
I don't understand why the other way didn't work but I'm unblocked. Thanks.
justin closed this discussion on 01 Jul, 2015 02:09 AM.