-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathcron.daily
More file actions
51 lines (39 loc) · 779 Bytes
/
Copy pathcron.daily
File metadata and controls
51 lines (39 loc) · 779 Bytes
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
#!/bin/bash
cd "$(dirname "$0")"
rm -r './app/storage/cache';
rm -r './app/storage/tmp';
mkdir './app/storage/cache' -p;
mkdir './app/storage/tmp' -p;
cd "$(dirname "$0")"
#!/bin/bash
stash() {
# check if we have uncommited changes to stash
git status --porcelain | grep "^." >/dev/null;
if [ $? -eq 0 ]
then
if git stash save -u "git-update on `date`";
then
stash=1;
fi
fi
}
unstash() {
# check if we have uncommited change to restore from the stash
if [ $stash -eq 1 ]
then
git stash pop;
fi
}
stash=0;
stash;
branch=`git branch | grep "\*" | cut -d " " -f 2-9`;
if [ "$branch" == "main" ]
then
git pull origin main;
else
git checkout main;
git pull origin main;
git checkout "$branch";
git rebase main;
fi
unstash;