File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,17 @@ git checkout -b $branch
5656# Update version dependencies
5757echo -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
6071sed -i "/const CI_VERSION/s/'.*'/'${version}${qualifier}'/" system/CodeIgniter.php
6172
@@ -113,6 +124,7 @@ read answer
113124if [ $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
116128fi
117129
118130#---------------------------------------------------
You can’t perform that action at this time.
0 commit comments