-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgerrit-tui.sh
More file actions
executable file
·36 lines (28 loc) · 823 Bytes
/
Copy pathgerrit-tui.sh
File metadata and controls
executable file
·36 lines (28 loc) · 823 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
GIT_REPO="${GIT_REPO:-$(git -C $(dirname ${BASH_SOURCE[0]}) rev-parse --show-toplevel)}"
export PYTHONPATH="${GIT_REPO}/src"
export LANG='en_US.UTF-8'
MISSING_DEPENDENCIES=()
function dependency_check() {
installed_pip_packages=$(pip list 2>/dev/null)
for DEP in "${@}";
do
if ! echo "${installed_pip_packages}" | grep -q "${DEP}"; then
MISSING_DEPENDENCIES+=("${DEP}")
fi
done
}
dependency_check urwid requests python-dateutil
if [ "${#MISSING_DEPENDENCIES[@]}" -ne 0 ]; then
echo "Please install missing dependencies with the following command:"
echo ""
echo -n " pip install "
for DEP in "${MISSING_DEPENDENCIES[@]}";
do
echo -n "${DEP} "
done
echo ""
exit 1
fi
python3 -B -m gerrit_tui