-
Notifications
You must be signed in to change notification settings - Fork 10
/
pushspec
executable file
·40 lines (33 loc) · 1011 Bytes
/
pushspec
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
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
read -t 30 -p "请输入版本号:" version
echo -e "\n"
echo "版本号为:$version"
specfilename=$(ls | grep .podspec | head -1)
if [[ $version != "" ]]; then
echo "======开始修改spec文件版本号======"
sed -i "" "s/s.version.*=.*/s.version = '$version' /g" ${specfilename}
if [ $? -ne 0 ]; then
echo "修改spec文件失败"
exit 0
else
echo "修改spec文件成功,version:$version"
git add -A && git commit -m "修改spec文件版本号:$version"
git push origin master
fi
echo "======开始打tag:$version======"
git tag $version
#是否执行成功
if [ $? -ne 0 ]; then
echo "打tag失败"
pod trunk push --verbose --allow-warnings
else
echo "打tag成功"
git push --tags
echo "======开始推送spec文件======"
pod trunk push --verbose --allow-warnings
fi
else
echo "======请输入tag======"
fi