From a3d20b4ab12a91d615972edbb945e2b95e83f882 Mon Sep 17 00:00:00 2001 From: sripwoud Date: Tue, 2 Jul 2024 13:49:10 +0200 Subject: [PATCH] feat: check if `make` is available --- .setup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.setup.sh b/.setup.sh index 9af16d1..bb004bb 100755 --- a/.setup.sh +++ b/.setup.sh @@ -2,13 +2,21 @@ set -eu ORANGE="\033[33m" +RED="\033[31m" RESET="\033[0m" log() { printf "%b\n" "$1" } -is_bin_locally_available() { +is_make_available() { + if ! command -v make >/dev/null; then + log "${RED}error: make is not available.$RESET\nPlease install ${ORANGE}make$RESET for your OS and run this script again." + return 1 + fi +} + +is_crate_bin_locally_available() { crate="$1" [ -x ".cargo/bin/$crate" ] }