加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
change_version.sh 928 Bytes
一键复制 编辑 原始数据 按行查看 历史
QilongZhang 提交于 2018-04-19 15:09 . update sofaark version to 0.3.0 (#39)
#!/bin/bash
shopt -s expand_aliases
if [ ! -n "$1" ] ;then
echo "Please enter a version"
exit 1
else
echo "The updated version is $1 !"
fi
currentVersion=`sed -n '/<project /,/<packaging/p' pom.xml | grep version | cut -d '>' -f2 | cut -d '<' -f1`
echo "The current version is $currentVersion"
if [ `uname` == "Darwin" ] ;then
echo "This is OS X"
alias sed='sed -i ""'
else
echo "This is Linux"
alias sed='sed -i'
fi
echo "Change version in root pom.xml ===>"
sed "/<project /,/<packaging/ s/<version>.*<\/version>/<version>$1<\/version>/" pom.xml
echo "Change version in subproject pom ===>"
for filename in `find . -name "pom.xml" -mindepth 2`;do
echo "Deal with $filename"
sed "/<parent>/,/<\/parent>/ s/<version>.*<\/version>/<version>$1<\/version>/" $filename
done
for filename in `find . -name "README*.md"`;do
echo "Deal with $filename"
sed "/badge\/maven/! s/$currentVersion/$1/" $filename
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化