Skip to content

Commit

Permalink
Add a function to ensure that a specific package can be installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickcarlohickman committed Jan 25, 2023
1 parent 7e4318b commit 2c1528d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions setup/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ function ensure_variable_set {
fi
}

function ensure_package_available {
if [[ -z "$(apt-cache search --names-only "^${1}")" ]]; then
log_error "Package ${1} was not found as an installable package."
exit 1
fi
}

function is_mysql_installed {
dpkg -l | egrep "ii\s*mysql-server\S*\s+" > /dev/null

Expand Down

0 comments on commit 2c1528d

Please sign in to comment.