-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpodspec-Commond.sh
More file actions
executable file
·92 lines (71 loc) · 1.46 KB
/
Copy pathpodspec-Commond.sh
File metadata and controls
executable file
·92 lines (71 loc) · 1.46 KB
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
#! /bin/bash
DIR=$(cd $(dirname $0); pwd);
cd $DIR
paths="$( find $DIR -name *.podspec )"
funWithPod() {
while :
do
podParams="--sources=https://github.com/CocoaPods/Specs.git --allow-warnings --use-libraries --verbose"
echo '1:本地验证(pod lib lint);2:远程验证(pod spec lint);3:提交到远程仓库(pod repo push) 4:提交到远程公共仓库:pod trunk push'
read aNum
case $aNum in
1) commond="pod lib lint $1 $podParams"
echo $commond
$commond
break;;
2) commond="pod spec lint $1 $podParams"
echo $commond
$commond
break;;
3) commond="pod repo push $2 $1 $podParams"
echo $commond
$commond
break;;
4) commond="pod trunk push --allow-warnings --use-libraries --verbose"
echo $commond
$commond
break;;
*) echo '没有找到你想操作的命令'
continue
;;
esac
done
}
funcWithPod() {
int=0
for file in ./*
do
if test -f $file && [[ $file =~ \.podspec$ ]] #匹配文件名以.podspec 结尾
then
array[int]=$file
let "int++"
fi
done
length=${#array[@]}
if [[ $length == 1 ]]; then
path=${array[0]}
echo $path
return
fi
spec="请选择一个spec文件:"
for (( i = 0; i < $int; i++ )); do
spec+="$i:"${array[i]}";"
done
while :
do
echo $spec
read aNum
if [[ $aNum -lt $length ]]; then
#statements
#echo ${array[$aNum]}
path=${array[$aNum]}
#return ${array[$aNum]}
break
else
continue
fi
done
}
funcWithPod
podStorage="Specs"
funWithPod $path $podStorage