Skip to content

Instantly share code, notes, and snippets.

@jason-riddle
Last active October 21, 2019 00:38
Show Gist options
  • Save jason-riddle/d17afd4e2c781117ab0bf2bf2c831bd0 to your computer and use it in GitHub Desktop.
Save jason-riddle/d17afd4e2c781117ab0bf2bf2c831bd0 to your computer and use it in GitHub Desktop.
Snippet to ensure command is available #complete
#!/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