Skip to content

Commit 503bdc4

Browse files
committed
Add uniqueness test
1 parent 117653c commit 503bdc4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

admin/release

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ git checkout -b $branch
5656
# Update version dependencies
5757
echo -e "${BOLD}Updating version dependencies${NORMAL}"
5858

59+
function check_unique (pattern, sourcefile) {
60+
count=`grep -o $1 < $2 | wc -l`
61+
if [ count -ne 1 ]; then
62+
echo "${BOLD}${COLOR}$2 has more than 1 occurence of '$1'${NORMAL}"
63+
exit 1
64+
fi
65+
}
66+
67+
# Make sure there is only one line to affect in each file
68+
check_unique "const CI_VERSION" "system/CodeIgniter.php"
69+
5970
# CI_VERSION definition in system/CodeIgniter.php
6071
sed -i "/const CI_VERSION/s/'.*'/'${version}${qualifier}'/" system/CodeIgniter.php
6172

@@ -113,6 +124,7 @@ read answer
113124
if [ $answer != 'yes' ]; then
114125
echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}"
115126
echo "Rerun this script when ready to deploy"
127+
exit 1
116128
fi
117129

118130
#---------------------------------------------------

0 commit comments

Comments
 (0)