Skip to content

Instantly share code, notes, and snippets.

@sc0ttj
Created May 20, 2025 16:12
Show Gist options
  • Save sc0ttj/521e8e2bb10a2084682682e7d4630939 to your computer and use it in GitHub Desktop.
Save sc0ttj/521e8e2bb10a2084682682e7d4630939 to your computer and use it in GitHub Desktop.
Simple shell deps functions
#!/bin/bash
# Declare requirements in bash scripts
set -e
function requires() {
if ! command -v $1 &>/dev/null; then
echo "Requires $1"
exit 1
fi
}
requires "jq"
requires "curl"
# etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment