-
Notifications
You must be signed in to change notification settings - Fork 10
/
update.sh
33 lines (28 loc) · 672 Bytes
/
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
#!/bin/bash
#sh update.sh u p
#Wenn p sonderzeichen enthält, dann muss es mit hochstrichen eingereicht werden
echo $1
git pull origin master
u=$1
p=$2
if [[ `git status --porcelain` ]]; then
echo 'changes detected'
git pull origin master
node update_data.js
else
echo 'no changes detected'
node update_data.js
fi
echo 'loop finished'
number=$(find data -type f | wc -l)
let number-=2
echo "Anzahl der Nodes: $number"
git add data/*
git commit -m "🗃 - Datenupdate $number"
if [[ $1 && $2 ]]; then
echo 'push with variables'
git push https://$u:[email protected]/CodeforKarlsruhe/direktvermarkter.git
else
echo 'push normaly'
git push origin master
fi