From fbb0220aaff7ca44868922f95142cfe8911e0099 Mon Sep 17 00:00:00 2001
From: Aymeric Bernard <aymeric.bernard@student.ecp.fr>
Date: Tue, 10 Apr 2018 21:08:10 +0200
Subject: [PATCH] Removed useless cd in update_server

---
 scripts/ecosystem.config.json |  2 +-
 scripts/update_server.sh      | 13 ++-----------
 2 files changed, 3 insertions(+), 12 deletions(-)
 mode change 100644 => 100755 scripts/update_server.sh

diff --git a/scripts/ecosystem.config.json b/scripts/ecosystem.config.json
index 8e35d18..8ae88c4 100644
--- a/scripts/ecosystem.config.json
+++ b/scripts/ecosystem.config.json
@@ -1,7 +1,7 @@
 {
   "apps": [
     {
-      "script": "../server/index.js",
+      "script": "server/index.js",
       "name": "tv-panel",
       "instances": "1",
       "exec_mode": "cluster"
diff --git a/scripts/update_server.sh b/scripts/update_server.sh
old mode 100644
new mode 100755
index 63437ac..8b4f37a
--- a/scripts/update_server.sh
+++ b/scripts/update_server.sh
@@ -1,27 +1,18 @@
 #!/bin/bash
 
-CWD=$(pwd)
-
-DIRECTORY=$(cd `dirname $0` && pwd)
-cd $DIRECTORY
-
 # Pull code
 git fetch
 # git reset --hard origin/master
 
 # Install deps
-cd ../
 yarn install --pure-lockfile
 
 # Build front
 yarn build:front
 
 # Restart server
-cd scripts
-pm2 startOrRestart ecosystem.config.json
+pm2 startOrRestart ./scripts/ecosystem.config.json
 
 # Restart screen
 screen -S TVPanelScreen -X quit
-./start_tv_panel.sh
-
-cd $CWD
+./scripts/start_tv_panel.sh
-- 
GitLab