-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
46 lines (36 loc) · 1.09 KB
/
provision.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
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
checkStringAndWrite() {
if grep -Fxq "$1" ~/.bashrc
then
echo "Exist: " $1
else
echo >> ~/.bashrc
echo $1 >> ~/.bashrc
fi
}
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
echo "Installing curl."
sudo apt install -y curl
echo "Installing poetry."
curl -sSL https://install.python-poetry.org | python3 -
echo "Adding poetry to PATH."
export PATH="/home/vagrant/.local/bin:$PATH"
checkStringAndWrite 'export PATH="/home/vagrant/.local/bin:$PATH"'
echo "Loading terminal prompt formatting from .bash_prompt."
checkStringAndWrite "# load terminal prompt formatting from"
checkStringAndWrite "source ~/.bash_prompt"
sudo ln -s /vagrant/.bash_prompt ~/.bash_prompt
source ~/.bashrc
echo "Installing pip."
sudo apt-get -y install python3-pip
echo "Installing pre-commit."
pip install --user pre-commit
cd /vagrant
pre-commit install
echo "Installing project dependencies and activating the virtual environment."
poetry config virtualenvs.in-project true
poetry env use python3.8
poetry install
poetry shell