#!/bin/bash mockery_v2_version=2.46.0 cd /tmp || exit 1 # mockery v2 we download from releases page arch=$(uname -m) download_url="https://github.com/vektra/mockery/releases/download/v${mockery_v2_version}/mockery_${mockery_v2_version}_Linux_${arch}.tar.gz" curl -L ${download_url} -o "/tmp/mockery_${arch}.tar.gz" mkdir /tmp/mockery_v2 tar xf "/tmp/mockery_${arch}.tar.gz" -C /tmp/mockery_v2 mv /tmp/mockery_v2/mockery /usr/local/bin/mockery_v2 rm -rf "/tmp/mockery_$(uname -m).tar.gz" /tmp/mockery*