-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·45 lines (36 loc) · 880 Bytes
/
lint.sh
File metadata and controls
executable file
·45 lines (36 loc) · 880 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
#!/usr/bin/env bash
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
if [ -z ${1} ]; then
echo "${RED}Version not specified. Use make lint version=x.x.x${RESET}"
exit 1
fi
STATUS=0
if [[ -n $(git status --porcelain) ]]; then
echo "${RED}Git directory not clean${RESET}"
STATUS=1
fi
if [ $(git describe --tags) != ${1} ]; then
echo "${RED}HEAD is not correctly tagged${RESET}"
STATUS=1
fi
echo "Linting…"
LINT=$(pod lib lint --sources='git@github.com:AnbionApps/AnbionPods.git,https://github.com/CocoaPods/Specs')
if [ $? -ne 0 ]; then
echo "${RED}Linting failed:${RESET}"
echo "${LINT}"
STATUS=1
fi
if ! $(echo ${LINT} | grep -qF "(${1})")
then
echo "${RED}Version in podspec incorrect${RESET}"
STATUS=1
fi
echo ""
if [ $STATUS == 0 ]; then
echo "${GREEN}All good!${RESET}"
else
echo "${RED}There were errors${RESET}"
fi
exit $STATUS