-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·35 lines (26 loc) · 867 Bytes
/
run.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
#!/bin/bash
# Getting script directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Saving origin path.
ORIGDIR=$(pwd)
# Cleaning old .pyc files to not run into the "importing seems to work" trap again!
find ${DIR} -name "*.pyc" -exec rm {} \;
# Changing to the root path of th application.
cd ${DIR}
# Checking if PYWISHLIST_CFG is set. If not, use the provided example file.
if [ -z "$PYWISHLIST_CFG" ]; then
if [ -f "dist/pywishlist.cfg" ]; then
echo "Setting PYWISHLIST_CFG for you. Please use your own settings for production!"
export PYWISHLIST_CFG="../dist/pywishlist.cfg"
else
export PYWISHLIST_CFG="../dist/pywishlist.cfg.example"
fi
fi
# Activating virtualenv
source venv/bin/activate
# Actually starting the application.
python pywishlist.py
# Deactivating virtualenv
deactivate
# Changing back to origin path.
cd ${ORIGDIR}