snipplets.dev/snipplets/code/Bash/command_exists.sh
2023-08-05 22:45:06 +03:00

13 lines
208 B
Bash

#!/bin/bash
if ! [ -x "$(command -v git)" ]; then
echo 'Error: git is not installed.' >&2
exit 1
fi
if ! command -v crystal &> /dev/null
then
echo "<the_command> could not be found"
exit
fi