#!/bin/bash

set -e

if [ "$APPVEYOR_BUILD_WORKER_IMAGE" = Ubuntu ]; then
    # allow it to fail because things might still install
    sudo apt update || true

    sudo apt install -y --no-install-recommends libncursesw5-dev ccache
    ccache -M 100Mi
fi

# installing ccache on macOS is useless, because brew kills all ccache's gains

if [ "$COLLECT_COVERAGE" = yes ] && [ -n "$COVERALLS_REPO_TOKEN" ]; then
    pip install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
fi
