From 8927ffec4f2de46710ce091302b64e73b95180d5 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Tue, 29 Jul 2025 04:32:23 +0530 Subject: [PATCH 1/8] Update script.sh --- backend/script.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/script.sh b/backend/script.sh index 9b54e95f..f1014b54 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -7,16 +7,21 @@ S2V_ARCHIVE="s2v_reddit_2015_md.tar.gz" S2V_DIR="s2v_old" if [ ! -d "venv" ]; then - python3 -m venv venv + python3 -m venv venv || python -m venv venv +fi + +if [[ "$OSTYPE" == "msys" ]]; then + source venv/Scripts/activate +else + source venv/bin/activate fi -source venv/bin/activate if [ ! -d "$REPO_DIR" ]; then git clone $REPO_URL fi if [ ! -f "$S2V_ARCHIVE" ]; then - wget $S2V_URL -O $S2V_ARCHIVE + curl -L $S2V_URL -o $S2V_ARCHIVE fi if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then @@ -24,5 +29,5 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi -# Deactivate virtual environment after completion -source deactivate \ No newline at end of file + +deactivate From a2719a723983d2f7763df34c426036c136aa6d50 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Tue, 29 Jul 2025 04:33:19 +0530 Subject: [PATCH 2/8] Update script.sh --- backend/script.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/script.sh b/backend/script.sh index f1014b54..a44ec964 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -6,11 +6,13 @@ REPO_DIR="EduAid" S2V_ARCHIVE="s2v_reddit_2015_md.tar.gz" S2V_DIR="s2v_old" +echo "Running on $OSTYPE" + if [ ! -d "venv" ]; then python3 -m venv venv || python -m venv venv fi -if [[ "$OSTYPE" == "msys" ]]; then +if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* || "$OSTYPE" == "win32" ]]; then source venv/Scripts/activate else source venv/bin/activate @@ -29,5 +31,4 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi - deactivate From 804344be2ee2649fcfab11c5f7c22ea2c3681975 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Tue, 29 Jul 2025 04:35:46 +0530 Subject: [PATCH 3/8] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 280574d2..9275764b 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,13 @@ You can choose to set up the backend manually or use an automated shell script. ``` - This script will automatically download and extract the Sense2Vec model, install Python dependencies, and start the Flask app. +### 🪟 Windows Users +If using Git Bash: +- Replace `python3` with `python` if needed. +- Use `source venv/Scripts/activate` instead of `source venv/bin/activate`. +- If `wget` is not available, `curl -L -o` is used in script. + + ### Troubleshooting - If the script fails to run, ensure that you have execution permissions: From af5829c4cb5cfe4fe05ab55aa4a13808178c9252 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Fri, 1 Aug 2025 13:25:31 +0530 Subject: [PATCH 4/8] Update script.sh --- backend/script.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/script.sh b/backend/script.sh index a44ec964..6c01c1be 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -31,4 +31,7 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi -deactivate +if declare -F deactivate >/dev/null 2>&1; then + deactivate +fi + From 194eae64d30b9d9eb7a91e0ad1b04b1e64729b08 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:28:02 +0530 Subject: [PATCH 5/8] Update script.sh --- backend/script.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/script.sh b/backend/script.sh index 6c01c1be..a3baa461 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -31,6 +31,7 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi +deactivate if declare -F deactivate >/dev/null 2>&1; then deactivate fi From c4a47fd5f3adc96e10b847d265d92c84408637f8 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:31:48 +0530 Subject: [PATCH 6/8] Update script.sh --- backend/script.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/script.sh b/backend/script.sh index a3baa461..b7765e46 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -9,6 +9,7 @@ S2V_DIR="s2v_old" echo "Running on $OSTYPE" if [ ! -d "venv" ]; then + python3 -m venv venv python3 -m venv venv || python -m venv venv fi @@ -17,12 +18,14 @@ if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* || "$OSTYPE" == "win32" ]]; else source venv/bin/activate fi +source venv/bin/activate if [ ! -d "$REPO_DIR" ]; then git clone $REPO_URL fi if [ ! -f "$S2V_ARCHIVE" ]; then + wget $S2V_URL -0 $S2V_ARCHIVE curl -L $S2V_URL -o $S2V_ARCHIVE fi @@ -31,7 +34,7 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi -deactivate +source deactivate if declare -F deactivate >/dev/null 2>&1; then deactivate fi From a20d5ef49b99b29b43571015c4ee6faf45363343 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:33:26 +0530 Subject: [PATCH 7/8] Update script.sh --- backend/script.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/script.sh b/backend/script.sh index b7765e46..48239d73 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -25,7 +25,7 @@ if [ ! -d "$REPO_DIR" ]; then fi if [ ! -f "$S2V_ARCHIVE" ]; then - wget $S2V_URL -0 $S2V_ARCHIVE + wget $S2V_URL -O $S2V_ARCHIVE curl -L $S2V_URL -o $S2V_ARCHIVE fi @@ -34,7 +34,6 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi -source deactivate if declare -F deactivate >/dev/null 2>&1; then deactivate fi From 55a7a0ade95e0f6cdb32490f3e59e85f97724891 Mon Sep 17 00:00:00 2001 From: Yuvika Gupta <154015713+yuvikaaaaaa@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:35:14 +0530 Subject: [PATCH 8/8] Update script.sh --- backend/script.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/script.sh b/backend/script.sh index 48239d73..859ef30c 100755 --- a/backend/script.sh +++ b/backend/script.sh @@ -34,7 +34,5 @@ if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1 fi -if declare -F deactivate >/dev/null 2>&1; then - deactivate -fi +source deactivate