What can we use to distinguish beetween linux and macos AppVeyor builds?

servoz's Avatar


25 Sep, 2021 02:45 PM

AppVeyor provides build worker images for windows, linux and macos to run unit tests.

So we can use the same appveyor.yml to control builds running on both these OS.

We can distinguish between windows and linux platforms by using few possibilities, as variables ($isLinux, $isWindows, APPVEYOR_YML_DISABLE_PS_LINUX) or prefix commands ( sh:, cmd:).

What can we use to distinguish beetween linux and macos ?

  1. Support Staff 1 Posted by Feodor Fitsner on 27 Sep, 2021 01:55 AM

    Feodor Fitsner's Avatar

    Maybe like this:

        platform=$(uname -s)
        if [[ $platform == Darwin ]]; then
            echo "it's macOS"
        elif [[ $platform == Linux ]]; then
            echo "it's Linux"
  2. 2 Posted by servoz on 27 Sep, 2021 06:13 AM

    servoz's Avatar

    Thank you for your help.Yes it is a solution, using shell commands.Initially, I was wondering if there is a solution provided by the appveyor build (like the variables provided to discern between windows and linux). This does not seem to be the case.So I think to use a solution like the one you propose.Thanks again!

  3. servoz closed this discussion on 28 Sep, 2021 10:21 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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