-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix
More file actions
executable file
·38 lines (28 loc) · 1.11 KB
/
Copy pathfix
File metadata and controls
executable file
·38 lines (28 loc) · 1.11 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
#! /bin/bash
# Safely execute this bash script
# e exit on first failure
# u unset variables are errors
# f disable globbing on *
# pipefail | produces a failure code if any stage fails
set -euf -o pipefail
# Get the directory of this script
LOCAL_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Setup virtual environment
PYTHON_ENV=$(python3 -c "import sys; sys.stdout.write(sys.prefix) if (hasattr(sys, 'real_prefix') or sys.base_prefix != sys.prefix) else sys.stdout.write('0')")
if [[ $PYTHON_ENV == 0 ]];
then
echo "Not in virtual environment"
ACTIVATE=~/temp/alignment-environment/bin/activate
if [ ! -f $ACTIVATE ]; then
echo "Virtual environment doesn't exist, making it..."
python3 -m venv ~/temp/alignment-environment
fi
source $ACTIVATE
else
echo "Running in virtual environment $PYTHON_ENV"
fi
# Make sure requirements are installed
pip install -r $LOCAL_DIRECTORY/requirements.txt > /dev/null
export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/.aws/google-cloud-credentials.json
# Start the dev environment
PYTHONPATH=$LOCAL_DIRECTORY python $LOCAL_DIRECTORY/align_speech/cli/fix.py $@