-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·56 lines (46 loc) · 1.24 KB
/
setup.sh
File metadata and controls
executable file
·56 lines (46 loc) · 1.24 KB
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
#!/usr/bin/env bash
set -e -o pipefail
: "${PROJECT:=lambda-example}"
: "${PYTHON_VERSION:=3.11}"
if [[ ! "$(uname -o)" =~ "Darwin" ]]; then
>&2 echo "Script is only valid for MacOS systems."
exit 1
fi
if ! which -s hatch 2> /dev/null ; then
>&2 echo "Install hatch utility globally"
>&2 echo " - brew install hatch"
exit 1
fi
if ! which -s zip 2> /dev/null ; then
>&2 echo "Install zip utility"
>&2 echo " - brew install zip"
exit 1
fi
if ! which -s jq; then
>&2 echo "Install jq"
>&2 echo " - brew install jq"
exit 1
fi
if ! docker 2> /dev/null ; then
>&2 echo "Install docker"
>&2 echo " - brew install --cask docker"
exit 1
fi
if ! python --version > /dev/null 2>&1 ; then
>&2 echo "Install python ${PYTHON_VERSION}"
>&2 echo " - brew install python@${PYTHON_VERSION}"
exit 1
fi
if ! pip --version > /dev/null 2>&1 ; then
>&2 echo "Install pip for python ${PYTHON_VERSION}"
exit 1
fi
if ! which -s virtualenv > /dev/null 2>&1 ; then
>&2 echo "Unable to locate virtualenv executable"
>&2 echo " - brew install virtualenv"
exit 1
fi
echo "Make sure to be in the '${PROJECT}' virtual environment."
echo "Run this command:"
echo " - hatch shell"
echo -e "\nYou are all set."