-
Notifications
You must be signed in to change notification settings - Fork 54
/
set_version.sh
executable file
·44 lines (34 loc) · 1 KB
/
set_version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
version_pattern="[0-9].[0-9].[0-9][-]*[0-9]*"
function change_deb_version() {
sed -i "s/Version:\s*${version_pattern}/Version: $1/" debian/build-src/DEBIAN/control
sed -i "s/\"version\":\s*\"${version_pattern}\"/\"version\": \"$1\"/" debian/build-src/opt/apps/cn.kingtous.fclash/info
}
# "version:".trParams({"version": '1.2.1-1'}),
function change_about_version() {
sed -i "s/\"version\":\s*'${version_pattern}'/\"version\": '$1'/" lib/screen/page/about.dart
}
#
function change_arch() {
echo "please change arch version manually for now."
}
# version: '1.2.1'
function change_snap() {
sed -i "s/version:\s*'${version_pattern}'/version: '$1'/" snap/snapcraft.yaml
}
if [[ ! $1 =~ ${version_pattern} ]]; then
echo './set_version.sh *.*.*[-*]'
exit 0
fi
# Flutter
echo "change flutter about page version."
change_about_version "$1"
# Deb
echo "change deb info."
change_deb_version "$1"
# Snap
echo "change snapcraft info."
change_snap "$1"
# Arch
echo "change arch info."
change_arch "$1"