#!/bin/bash set -eu # Change version number to a release/tag available on the mono repo to update it # https://github.com/appsignal/mono/releases MONO_VERSION="v0.5.7" MONO_PATH="$HOME/mono" has_cache=false if which cache >/dev/null; then has_cache=true fi if $has_cache; then echo "Restoring mono cache" cache restore mono-$MONO_VERSION fi # Download mono if the cache restored nothing if [ ! -d $MONO_PATH ]; then mkdir -p $MONO_PATH curl --location https://github.com/appsignal/mono/archive/refs/tags/$MONO_VERSION.tar.gz | \ tar -xz --strip-components=1 --directory $MONO_PATH if $has_cache; then echo "Storing mono cache" cache store mono-$MONO_VERSION $MONO_PATH fi fi cd $MONO_PATH # Install mono always as it adds itself to the PATH script/setup