added build commit no #31
14
build.sh
14
build.sh
@ -33,18 +33,24 @@ key=" \"version\": \""
|
|||||||
|
|
||||||
count=$(echo ${version%%-*} | grep -o "\." | wc -l)
|
count=$(echo ${version%%-*} | grep -o "\." | wc -l)
|
||||||
if (( $count > 1 )); then
|
if (( $count > 1 )); then
|
||||||
version=${version%%-*}
|
version=${version%%-*}
|
||||||
else
|
else
|
||||||
version="${version%%-*}.0"
|
if [[ "$1" == "dev" ]];then
|
||||||
|
cleanprefix=${version#*-}
|
||||||
|
cleansuffix=${cleanprefix%-*}
|
||||||
|
version="${version%%-*}.${cleansuffix}"
|
||||||
|
else
|
||||||
|
version="${version%%-*}.0" # one `%` remove everything after last `-`, two `%%` remove everything after all `-`
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -f "$file_pkg" ] && [ ! -z "$version" ]; then
|
if [ -f "$file_pkg" ] && [ ! -z "$version" ]; then
|
||||||
version=" \"version\": \"$version\","
|
version=" \"version\": \"$version\","
|
||||||
sed -i "s|^.*$key.*|${version//\//\\/}|g" $file_pkg
|
sed -i "s|^.*$key.*|${version//\//\\/}|g" $file_pkg
|
||||||
text=$(cat $file_pkg | grep -c "$version")
|
text=$(cat $file_pkg | grep -c "$version")
|
||||||
if [ $text -eq 0 ]; then
|
if [ $text -eq 0 ]; then
|
||||||
echo "Version couldn't be set"
|
echo "Version couldn't be set"
|
||||||
else
|
else
|
||||||
echo "Version $version successfully applied to App"
|
echo "Version $version successfully applied to App"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user