-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.sh
94 lines (83 loc) · 1.83 KB
/
helper.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/zsh
arg="$1"
function showPopup()
{
popupMsg=$1
osascript -e "display notification \"$popupMsg\" with title \"LastDays Helper\""
}
function goToRepo()
{
cd `dirname $0`
}
function pullMaster()
{
goToRepo
echo "pull master `pwd`"
git fetch origin
git merge origin master
if [ $? -eq 0 ]; then
showPopup "Merge with master succeeded!"
else
showPopup "Merge with master failed. Run \'git status\' for details."
fi
}
function push()
{
goToRepo
branch=`git branch --show-current`
git push origin $branch
if [ $? -eq 0 ]; then
showPopup "Pushed to the server successfully!"
else
showPopup "Push to the server failed. Try \'git push origin $branch\'"
fi
}
function commit()
{
goToRepo
open -a GitHub\ Desktop
}
function cleanup()
{
goToRepo
find . -name 'Intermediate' -exec rm -Rf {} \;
"/Users/Shared/Epic Games/UE_4.23/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" `pwd`/LastDays.uproject
git submodule init
git submodule update --recursive
xcodebuild -workspace LastDays.xcworkspace -scheme LastDays
if [ $? -eq 0 ]; then
showPopup "Cleaned up!"
else
showPopup "Cleaned up, but couldn't build the project. Try opening Xcode and build it manually."
fi
}
function showLatest()
{
goToRepo
branch=`git branch --show-current`
commit=`git describe --always`
latestCommit=`git log -1 --pretty=%B`
msg="Branch: $branch. Latest: $commit: $latestCommit"
showPopup "$msg"
# osascript -e "display notification \"$msg\" with title \"LastDays Helper\""
}
case $arg in
--pull-master)
pullMaster
;;
--commit)
commit
;;
--cleanup)
cleanup
;;
--latest)
showLatest
;;
--push)
push
;;
*)
echo "unknown option $1"
;;
esac