Skip to content

Commit

Permalink
Updated backend script
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanabc committed Dec 16, 2024
1 parent 646d02b commit 071e09b
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions backend/script.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
#!/bin/bash
# #!/bin/bash

REPO_URL="https://github.com/AOSSIE-Org/EduAid.git"
S2V_URL="https://github.com/explosion/sense2vec/releases/download/v1.0.0/s2v_reddit_2015_md.tar.gz"
REPO_DIR="EduAid"
S2V_ARCHIVE="s2v_reddit_2015_md.tar.gz"
S2V_DIR="s2v_old"

if [ ! -d "venv" ]; then
python3 -m venv venv
fi
source venv/bin/activate

if [ ! -d "$REPO_DIR" ]; then
git clone $REPO_URL
if [ -d "$S2V_DIR" ]; then
echo "Directory exists, skipping"
exit 0
fi

if [ ! -f "$S2V_ARCHIVE" ]; then
echo "Downloading S2V.."
wget $S2V_URL -O $S2V_ARCHIVE
fi

if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then
mkdir -p $REPO_DIR/$S2V_DIR
tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1
fi
# Extract the archive
mkdir -p $S2V_DIR
echo "Extracting archive into '$S2V_DIR'..."
tar -xzvf $S2V_ARCHIVE

# Deactivate virtual environment after completion
source deactivate
# Cleanup
rm $S2V_ARCHIVE

0 comments on commit 071e09b

Please sign in to comment.