-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate.sh
executable file
·53 lines (41 loc) · 1.28 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/bash
# #################################################################################
#
# WebIndoor system script
# update files from repository
#
# #################################################################################
## working repository
if [ -z "$1" ]; then
REPO="inoteska"
else
REPO="$1"
fi
## working dir
cd /root/app
## backup app file
cp -f public/storage/store.dat /root/tmp
## stash all changes
git reset --hard
## synchronize
#if [ -z "$1" ]; then
## git fetch https://github.com/isra67/indoorjs.git master
# git fetch https://github.com/isra67/indoorjs.git
#else
## git fetch https://isra67:[email protected]/isra67/indoorjs.git master
# git fetch https://isra67:[email protected]/isra67/indoorjs.git
#fi
#git reset --hard ##gh/master
#if [ -z "$1" ]; then
## git pull --rebase https://github.com/isra67/indoorjs.git master
# git pull --rebase https://github.com/isra67/indoorjs.git
#else
## git pull --rebase https://isra67:[email protected]/isra67/indoorjs.git master
# git pull --rebase https://isra67:[email protected]/isra67/indoorjs.git
#fi
git pull --rebase https://[email protected]/$REPO/indoorjs.git
git clean -dn
## restore app file from backup
cp -f /root/tmp/store.dat public/storage
## install NPM files
npm install --silent