shashidharak99 commited on
Commit
be9e41e
·
verified ·
1 Parent(s): 6cfc6bc

Update update.sh

Browse files
Files changed (1) hide show
  1. update.sh +8 -5
update.sh CHANGED
@@ -1,6 +1,6 @@
1
  #!/bin/bash
2
 
3
- cd /app/project
4
 
5
  echo "Updating repository..."
6
 
@@ -10,17 +10,20 @@ echo "Installing dependencies..."
10
 
11
  npm install
12
 
13
- echo "Rebuilding project..."
14
 
15
  npm run build
16
 
17
  rm -rf /var/www/html/*
18
 
19
- # Detect output folder automatically
20
  if [ -d "dist" ]; then
21
  cp -r dist/* /var/www/html/
22
- elif [ -d "build" ]; then
 
 
 
23
  cp -r build/* /var/www/html/
24
  fi
25
 
26
- echo "Deployment updated successfully"
 
1
  #!/bin/bash
2
 
3
+ cd /app/project || exit
4
 
5
  echo "Updating repository..."
6
 
 
10
 
11
  npm install
12
 
13
+ echo "Building latest version..."
14
 
15
  npm run build
16
 
17
  rm -rf /var/www/html/*
18
 
19
+ # Vite
20
  if [ -d "dist" ]; then
21
  cp -r dist/* /var/www/html/
22
+ fi
23
+
24
+ # CRA
25
+ if [ -d "build" ]; then
26
  cp -r build/* /var/www/html/
27
  fi
28
 
29
+ echo "Deployment updated at $(date)"