Last active
November 25, 2017 06:12
-
-
Save fhuitelec/036435fdbde85a7d3df76593818c6c86 to your computer and use it in GitHub Desktop.
[Check command is installed] Cheatsheet to check if command is installed #zsh #shell #cheatsheet
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 zsh | |
# | |
# Check command is installed | |
# | |
if ! [ -x "$(command -v jq)" ]; then | |
echo 'Error: jq is not installed. Please install it to run this command' >&2 | |
exit 127 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment