-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.sh
executable file
·65 lines (49 loc) · 1.47 KB
/
upload.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
#!/bin/bash
Cyan='\033[0;36m'
Default='\033[0;m'
versionName=""
commitContent=""
confirmed="n"
getVersionName() {
read -p "Enter Version Name: " versionName
if test -z "$versionName"; then
getVersionName
fi
}
getCommitContent() {
read -p "Enter Commit Content: " commitContent
if test -z "$commitContent"; then
commitContent
fi
}
getInfomation() {
getVersionName
getCommitContent
echo -e "\n${Default}================================================"
echo -e " Version Name : ${Cyan}${versionName}${Default}"
echo -e " Commit Content : ${Cyan}${commitContent}${Default}"
echo -e "================================================\n"
}
echo -e "\n"
while [ "$confirmed" != "y" -a "$confirmed" != "Y" ]
do
if [ "$confirmed" == "n" -o "$confirmed" == "N" ]; then
getInfomation
fi
read -p "confirm? (y/n):" confirmed
done
git stash
git pull origin master --tags
git stash pop
VersionString=`grep -E 's.version.*=' JDNetWorkManager.podspec`
VersionNumber=`tr -cd 0-9 <<<"$VersionString"`
VersionString=`grep -E 's.version.*=' JDNetWorkManager.podspec`
LineNumber=`grep -nE 's.version.*=' JDNetWorkManager.podspec | cut -d : -f1`
sed -i "" "${LineNumber}s/${VersionNumber}/${versionName}/g" JDragonNetWork.podspec
git add .
git commit -a -m ${commitContent}
git tag ${versionName}
git push origin master --tags
set the new version to versionName
set the new tag to versionName
git push origin master && pod trunk push JDNetWorkManager.podspec --verbose --allow-warnings --use-libraries