File size: 2,089 Bytes
0ad74ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
#!/bin/bash -eu
#######################################
# Tell the user what programs to install for a specific task.
# Arguments:
# Name of the program or actual command, a string.
# External link for easier installation help.
# Outputs:
# Prints the required program name and the external link (if given).
#######################################
function program_required() {
if [ ! -x "$(command -v ${1})" ]; then
echo "${1} is not installed on the computer..."
if [ "${2}" ]; then
echo "Check out this link: ${2}"
fi
exit 1
fi
}
#######################################
# Check for the PIP program.
# Arguments:
# None
# Outputs:
# None
#######################################
function pip_required() {
program_required "pip" "https://pip.pypa.io/en/stable/installation/"
}
#######################################
# Check for the NPM program.
# Arguments:
# None
# Outputs:
# None
#######################################
function npm_required() {
program_required "npm" "https://nodejs.org/en/download/"
}
#######################################
# Check for the PNPM program.
# Arguments:
# None
# Outputs:
# None
#######################################
function pnpm_required() {
program_required "pnpm" "https://pnpm.io/installation"
}
#######################################
# Check for the AWS CLI program.
# Arguments:
# None
# Outputs:
# None
#######################################
function aws_required() {
program_required "aws" "https://aws.amazon.com/cli/"
}
#######################################
# Check for the Git program.
# Arguments:
# None
# Outputs:
# None
#######################################
function git_required() {
program_required "git" "https://git-scm.com/downloads"
}
#######################################
# Check for the jq program.
# Arguments:
# None
# Outputs:
# None
#######################################
function jq_required() {
program_required "jq" "https://jqlang.github.io/jq/"
}
function foo_required() {
program_required "foo" "https://jqlang.github.io/jq/"
}
|