Make update script smarter to reduce restarts

This commit is contained in:
Conor 2021-01-19 14:28:19 +00:00 committed by GitHub
parent 384d2d924c
commit 9322ce914a
Signed by untrusted user: github
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -9,8 +9,11 @@ for d in dlux*/ ; do
v=${d%/}
echo "Updating ${d}"
cd $d
git pull # update from git
npm i # update packages
pm2 restart $v # restart node
update=`git pull`
if [ "$update" != "Already up to date." ]
then
npm i # update packages
pm2 restart $v # restart node
fi
cd ..
done