Update helper_functions

- Modify check pip to make it clear it checks the system python
- Add generic sounding "run_command", in case we switch away from pipenv
This commit is contained in:
Devon Mackay 2018-07-09 12:10:56 -04:00
parent 6b31da0a0b
commit 05c42e5988

View File

@ -2,8 +2,18 @@
# Check pip to see if the given package is installed
# (returns 0 if installed, 2 if not installed)
check_pip_for () {
check_system_pip_for () {
local package_name="${1}"
# Use 'pip list' to see if the requested package is already installed
return $(pip list --format=columns --disable-pip-version-check | \
grep -Fe "${1}" >/dev/null 2>&1)
pip list --format=columns --disable-pip-version-check | \
grep -Fe "${package_name}" >/dev/null 2>&1
return $?
}
# Used whenever an environment sensitive command is being run
run_command () {
local cmd="${1}"
pipenv ${cmd}
return $?
}