forked from cherry-game/cherry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathver.sh
22 lines (16 loc) · 899 Bytes
/
ver.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
echo "[VER] ------------------------------------------------------"
# shellcheck disable=SC2162
read -p "[VER] enter new version(eg. 1.3.12):" number
echo ""
file_path='const/const.go'
sed -i 's/version\s*=\s*"[0-9.]\+"/version = "'"${number}"'"/' ${file_path}
file_path='components/**/go.mod'
sed -i 's/cherry v[0-9.]\+/cherry v'"${number}"'/' ${file_path}
file_path='examples/go.mod'
sed -i 's/cherry v[0-9.]\+/cherry v'"${number}"'/' ${file_path}
sed -i 's/components\/cron v[0-9.]\+/components\/cron v'"${number}"'/' ${file_path}
sed -i 's/components\/data-config v[0-9.]\+/components\/data-config v'"${number}"'/' ${file_path}
sed -i 's/components\/gin v[0-9.]\+/components\/gin v'"${number}"'/' ${file_path}
sed -i 's/components\/gops v[0-9.]\+/components\/gops v'"${number}"'/' ${file_path}
sed -i 's/components\/gorm v[0-9.]\+/components\/gorm v'"${number}"'/' ${file_path}