views:

300

answers:

4

I'm running a little find and replace utility called fart.exe (yes, fart, as in Find and Replace Text) as part of my CC build. Works great.

The problem is that FART while it is working displays a little ASCII spinner composed of pipe, dash, slash... | / - . There isn't a way to suppress this spinner, and CC thinks these little symbols are error messages and the build fails. I've tried:

  • adding those symbols as successexitcodes in CC -- same result, apparently only ints work
  • Calling fart via a batch file with ECHO OFF -- it still outputs the spinner and causes the build to fail

Any other ideas?

<exec>
<executable>C:\fart.exe</executable>
<buildArgs>myfile.txt string1 string2</buildArgs>
<successExitCodes>1,0</successExitCodes>
</exec>
A: 

The successExitCodes list is supposed to be a list of ints. Here's a couple of suggestions:

  1. Create a small batch file that runs the executable and call your batch file (instead of fart) using the executable task.
  2. Try removing the non ints from the successExitCodes and verify what exit code fart is returning... sometimes you get unexpected return codes, like when using robocopy.
TskTsk
Good thoughts, thanks for your help. I tried #1, same result (question updated to specify that). As for #2 I tried it with just numeric exit codes. I don't think that fart is outputting any strange error codes because occasionally it runs fast enough that it doesn't have to show the spinner. When that happens the build succeeds.
BrianM
Hmmmm the only other idea that comes to mind is to create a separate process from the batch file... maybe that way the output won't get sent to CC. Something like this:start /w cmd /c fart.exe
TskTsk
Tried your idea, no dice -- @ECHO OFF start /w cmd /c C:\fart.exe -- still outputs the spinner and causes build to fail. Thanks for your help.
BrianM
A: 

For command line apps, you can redirect output to a file using the '>' character. A call to your app would look like:

fart.exe myfile.txt string1 string2 > myoutput.txt

Adding the redirect to your buildArgs property should do the trick.

Pedro
Good thought, I actually tried that as well. It still outputs the spinner.
BrianM
+1  A: 

Thanks for the answers, but I ended up doing two things:

  • Recompiled the text replacement app (fart) without the spinner. Even after doing this CC was still failing for some reason, so I...
  • Moved batch executables to the msbuild file instead of cc config file. CC then built successfully.

I'm sure if I understood CC better I could have gone about this better way but for now this does the trick!

BrianM
A: 

I also ran into this issue with fart and a ci system. Rather than recompile the executable, I redirected the output to NUL.

First I determined that the spinner output was on stderr. Then I appended "2>NUL" to the command line which called fart, and it no longer farted a spinner on stderr.

Anybody else getting a pinwheel in a smelly breeze visual from that last sentence?

Binary Phile