#!/bin/bash set -euo pipefail cache="$*" cmd="$1"; shift cache="${cache// /,}" cache="cache/$cache" if cp -v "$cache" "$CARGO_HOME"/bin/"$cmd"; then exit 0; fi mkdir -p cache cargo install "$@" "$cmd" cp -v "$CARGO_HOME/bin/$cmd" "$cache"