-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
46 lines (40 loc) · 1.02 KB
/
setup.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 -e
# ===================
# DEFINIMOS VARIABLES
# ===================
VENV=venv
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
# =========================
# CREAMOS ENTORNO VIRTUAL
# =========================
printf "Creamos entorno virtual ...\t"
if [ ! -d "$VENV" ]
then
PYTHON=`which python3`
if [ ! -f $PYTHON ]
then
echo "Could not find python3"
fi
virtualenv -p $PYTHON $VENV
fi
printf "OK\n"
# =========================
# ACTIVAMOS ENTORNO VIRTUAL
# =========================
printf "Activamos entorno virtual ...\t"
. $VENV/bin/activate
printf "OK\n"
# =================================
# INSTALAMOS DEPENDENCIAS DE PYTHON
# =================================
printf "Instalamos dependencias de Python ...\t"
pip install -r requirements.txt > /dev/null 2>&1
printf "OK\n"
# ==================
# ASIGNAMOS PERMISOS
# ==================
printf "Asignamos permisos al Skill ...\t"
sudo chmod -R 775 $SCRIPTPATH
sudo chown -R _snips-skills:_snips-skills $SCRIPTPATH
printf "OK\n"