























原文:https://ichochy.com/posts/shell/20190212.html
实现原理:通过svn info查看svn信息,使用grep获取版本信息,用awk获取版本号,然后对比版本号是否需要更新
#!/bin/sh
revision=`svn info |grep "Last Changed Rev:" |awk '{print $4}'`
echo "the revision is $revision"
URL=`svn info |grep ^URL: |awk '{print $2}'`
echo "the url is $URL"
svnRevision=`svn info $URL |grep "Last Changed Rev:" |awk '{print $4}'`
echo "the revision in svn is $svnRevision"
if [[ $revision < $svnRevision ]] ; then
echo "need svn up"
svn up
echo "svn up finish"
else
echo "no need svn up"
fi
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。