mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 22:58:51 +00:00
avoiding the use o regex text && spliting some lines to increase the readability && making some code comments
This commit is contained in:
parent
21106bd70a
commit
c8fe3fe7a4
1 changed files with 27 additions and 5 deletions
32
bump_version
32
bump_version
|
@ -8,9 +8,10 @@
|
||||||
#
|
#
|
||||||
# Then check the diff manually to confirm that everything is ok.
|
# Then check the diff manually to confirm that everything is ok.
|
||||||
|
|
||||||
|
# exit immediately if something fails
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ $# != 1 ]]
|
if [ $# -ne 1 ]
|
||||||
then
|
then
|
||||||
echo "Syntax: $0 <version>" >&2
|
echo "Syntax: $0 <version>" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -18,7 +19,11 @@ fi
|
||||||
|
|
||||||
VERSION="$1"
|
VERSION="$1"
|
||||||
|
|
||||||
|
# Split in array through the '.'
|
||||||
a=( ${VERSION//./ } )
|
a=( ${VERSION//./ } )
|
||||||
|
|
||||||
|
# If {major,minor,patch} is not provided,
|
||||||
|
# 0 (zero) is default
|
||||||
MAJOR="${a[0]:-0}"
|
MAJOR="${a[0]:-0}"
|
||||||
MINOR="${a[1]:-0}"
|
MINOR="${a[1]:-0}"
|
||||||
PATCH="${a[2]:-0}"
|
PATCH="${a[2]:-0}"
|
||||||
|
@ -26,9 +31,26 @@ PATCH="${a[2]:-0}"
|
||||||
# If VERSION is 1.23.4, then VERSION_CODE is 12304
|
# If VERSION is 1.23.4, then VERSION_CODE is 12304
|
||||||
VERSION_CODE="$(( $MAJOR * 10000 + $MINOR * 100 + "$PATCH" ))"
|
VERSION_CODE="$(( $MAJOR * 10000 + $MINOR * 100 + "$PATCH" ))"
|
||||||
|
|
||||||
echo "$VERSION: major=$MAJOR minor=$MINOR patch=$PATCH [versionCode=$VERSION_CODE]"
|
echo """
|
||||||
|
$VERSION: \
|
||||||
|
major=$MAJOR \
|
||||||
|
minor=$MINOR \
|
||||||
|
patch=$PATCH \
|
||||||
|
[versionCode=${VERSION_CODE}] \
|
||||||
|
"""
|
||||||
|
|
||||||
sed -i "s/^\(\s*version: \)'[^']*'/\1'$VERSION'/" meson.build
|
sed -i "s/^\(\s*version: \)'[^']*'/\1'$VERSION'/" meson.build
|
||||||
sed -i "s/^\(\s*versionCode \).*/\1$VERSION_CODE/;s/^\(\s*versionName \).*/\1\"$VERSION\"/" server/build.gradle
|
|
||||||
sed -i "s/^\(SCRCPY_VERSION_NAME=\).*/\1$VERSION/" server/build_without_gradle.sh
|
sed -i "{
|
||||||
sed -i "s/^\(\s*VALUE \"ProductVersion\", \)\"[^\"]*\"/\1\"$VERSION\"/" app/scrcpy-windows.rc
|
s/^\(\s*versionCode \).*/\1$VERSION_CODE/
|
||||||
|
s/^\(\s*versionName \).*/\1\"$VERSION\"/
|
||||||
|
}" server/build.gradle
|
||||||
|
|
||||||
|
sed -i "s/^\(SCRCPY_VERSION_NAME=\).*/\1$VERSION/" \
|
||||||
|
server/build_without_gradle.sh
|
||||||
|
|
||||||
|
sed -i "{
|
||||||
|
s/^\(\s*VALUE \"ProductVersion\", \)\"[^\"]*\"/\1\"$VERSION\"/
|
||||||
|
}" app/scrcpy-windows.rc
|
||||||
|
|
||||||
echo done
|
echo done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue