Reaperxxxx commited on
Commit
4ccba0a
·
verified ·
1 Parent(s): 959e0c5

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +11 -3
start.sh CHANGED
@@ -6,10 +6,18 @@ if [ -z "$GITHUB_TOKEN" ]; then
6
  exit 1
7
  fi
8
 
9
- echo "Cloning repo..."
10
- git clone https://$GITHUB_TOKEN@github.com/reaperofssa/ChatNest.git /app
11
 
12
- cd /app
 
 
 
 
 
 
 
 
 
13
 
14
  echo "Starting server..."
15
  node server.js
 
6
  exit 1
7
  fi
8
 
9
+ REPO_DIR="/app/ChatNest"
 
10
 
11
+ if [ -d "$REPO_DIR/.git" ]; then
12
+ echo "Repo exists, pulling latest changes..."
13
+ cd "$REPO_DIR"
14
+ git reset --hard
15
+ git pull
16
+ else
17
+ echo "Cloning private repo..."
18
+ git clone https://$GITHUB_TOKEN@github.com/reaperofssa/ChatNest.git "$REPO_DIR"
19
+ cd "$REPO_DIR"
20
+ fi
21
 
22
  echo "Starting server..."
23
  node server.js