Last active
October 21, 2019 00:38
-
-
Save jason-riddle/d17afd4e2c781117ab0bf2bf2c831bd0 to your computer and use it in GitHub Desktop.
Snippet to ensure command is available #complete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function req() { | |
what=$1 | |
which "${what}" >/dev/null || { echo "${what} required"; exit 1; } | |
} | |
req curl | |
req gcc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment