-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
37 lines (29 loc) · 912 Bytes
/
install.sh
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
#!/bin/bash
# ==========================================================================
# Setup script for installing project dependencies.
# NOTE: Run this script while in the project root directory.
# ==========================================================================
# Set script to exit on any errors.
set -e
init() {
# Ensure that we're in a virtualenv.
python -c 'import sys; sys.prefix != sys.base_prefix' 2>/dev/null || (
echo 'Please activate your virtualenv before running this script.' &&
exit 1
)
}
# Test that Poetry is installed
if ! command -v poetry &> /dev/null
then
echo "Poetry could not be found"
echo "Please install poetry before running this script"
echo "https://python-poetry.org/docs/#installation"
exit
fi
# Install project dependencies.
install() {
echo 'Installing dependencies with Poetry...\n'
poetry install
}
init "$1"
install