diff options
author | kx <kx@radix.pro> | 2023-03-24 03:55:33 +0300 |
---|---|---|
committer | kx <kx@radix.pro> | 2023-03-24 03:55:33 +0300 |
commit | bfc1508d26c89c9a36d2d9a827fe2c4ed128884d (patch) | |
tree | 8d41298a7072a3e289e4912f77ece75cbea1bd54 /auto-clean | |
parent | c836ae3775cf72f17e0b7e3792d156fdb389bee3 (diff) | |
download | csvn-ui-bfc1508d26c89c9a36d2d9a827fe2c4ed128884d.tar.xz |
Version 0.1.4
Diffstat (limited to 'auto-clean')
-rwxr-xr-x | auto-clean | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/auto-clean b/auto-clean new file mode 100755 index 0000000..b100d64 --- /dev/null +++ b/auto-clean @@ -0,0 +1,40 @@ +#!/bin/bash + +CWD=`pwd` + +program=`basename $0` + +usage() { + cat << EOF + +Usage: $program [options] + +Options: + -h,--help Display this message. + +EOF +} + +if [ -f "${CWD}/Makefile" ] ; then + make distclean +fi + +svnignore='.svnignore' + +while read ln; do + line=`echo "${ln}" | sed 's,^[ \t],,' | sed 's,[ \t]$,,'` + if [ "x$line" != "x" -a "${line:0:1}" != "#" ] ; then + if `echo "${line}" | grep -q '\*~$'` ; then + find "`dirname "${line}"`" -type f -iname '*~' -print0 | while IFS= read -r -d '' file ; do + rm -f "$file" + done + elif `echo "${line}" | grep -q '\*'` ; then + find "`dirname "${line}"`" -type f -iname "`basename "${line}"`" -print0 | while IFS= read -r -d '' file ; do + rm -f "$file" + done + else + if [ -d "${line}" ] ; then rm -rf "${line}" ; fi + if [ -f "${line}" ] ; then rm -f "${line}" ; fi + fi + fi +done < ${CWD}/${svnignore} |