1 Star 0 Fork 0

Mr-老鬼/scrcpy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bump_version 935 Bytes
一键复制 编辑 原始数据 按行查看 历史
Romain Vimont 提交于 2021-12-10 19:50 . Add script to bump version
#!/usr/bin/env bash
#
# This script bump scrcpy version by editing all the necessary files.
#
# Usage:
#
# ./bump_version 1.23.4
#
# Then check the diff manually to confirm that everything is ok.
set -e
if [[ $# != 1 ]]
then
echo "Syntax: $0 <version>" >&2
exit 1
fi
VERSION="$1"
a=( ${VERSION//./ } )
MAJOR="${a[0]:-0}"
MINOR="${a[1]:-0}"
PATCH="${a[2]:-0}"
# If VERSION is 1.23.4, then VERSION_CODE is 12304
VERSION_CODE="$(( $MAJOR * 10000 + $MINOR * 100 + "$PATCH" ))"
echo "$VERSION: major=$MAJOR minor=$MINOR patch=$PATCH [versionCode=$VERSION_CODE]"
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 "s/^\(\s*VALUE \"ProductVersion\", \)\"[^\"]*\"/\1\"$VERSION\"/" app/scrcpy-windows.rc
echo done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Mr_laogui/scrcpy.git
git@gitee.com:Mr_laogui/scrcpy.git
Mr_laogui
scrcpy
scrcpy
master

搜索帮助