Skip to content

Instantly share code, notes, and snippets.

@lite
Created August 28, 2013 18:37
Show Gist options
  • Save lite/6369622 to your computer and use it in GitHub Desktop.
Save lite/6369622 to your computer and use it in GitHub Desktop.
#!env /bin/bash
svn_clean(){
echo remove .svn in $1
find $1 -type d -name .svn -print0 | xargs -0 rm -rf
}
svn_submit(){
s_cnt=`find $1 -type f |wc -l`
echo $1 have $s_cnt files
if [ $(($s_cnt/1)) -lt 2000 ]; then
svn add $1 --force
svn commit -m "add $1 force"
else
svn add $1 --depth=files --force
svn commit -m "add $1"
for file in `ls $1`
do
path=$1/${file}
if [ -d ${path} ]; then
svn_submit ${path}
fi
done
fi
}
#[~/dth/git.dev/dth-repo/cdn/100642705]$ bash ../ci.sh files/assets_18
ACTION="$1"
case $ACTION in
-c) svn_clean $2;;
-s) svn_submit $2;;
*) echo "-c clean .svn folder, -s need server.";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment