How to ignore exit codes of a cmd

Geert van Horrik's Avatar

Geert van Horrik

01 Dec, 2014 04:59 PM

I have created this PR:

https://github.com/oxyplot/oxyplot/pull/267/files

As you can see it has failed because some projects don't produce PDB's (which is fine for me). But the tool returns -1 because it allows people to use a strict mode to check for all projects. In this case it's not necessary, but I don't want the build to fail on a non-0 exit code. How can I allow -1 to be returned?

Thanks!

  1. Support Staff 1 Posted by Feodor Fitsner on 01 Dec, 2014 05:29 PM

    Feodor Fitsner's Avatar

    A quick idea - you can do a "wrapping" batch file, say gitlink.cmd and set exit code to 0 before exit.

  2. 2 Posted by Geert van Horri... on 02 Dec, 2014 04:38 PM

    Geert van Horrik's Avatar

    Good idea. In the meantime I have decided to just make it work on all projects, but I will keep this in mind until next time.

  3. 3 Posted by ferventcoder on 30 Apr, 2015 09:45 PM

    ferventcoder's Avatar

    You should do this -

    command && exit 0

    Proof that it works https://ci.appveyor.com/project/puppetlabs/puppetlabs-acl/build/1.1...

    Look at the next few lines, that was throwing errors and exiting with non-zero exit code

  4. 4 Posted by Jeff Walker on 18 Dec, 2017 02:50 AM

    Jeff Walker's Avatar

    Pretty sure that should be:

    command & exit 0

    with only a single ampersand. Otherwise, it stops when the command stops and that is the error code you get.

  5. 5 Posted by ferventcoder on 01 Jan, 2018 09:17 PM

    ferventcoder's Avatar

    Hi Jeff,
    You are likely correct there.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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