summaryrefslogtreecommitdiff
path: root/auto-clean
diff options
context:
space:
mode:
authorkx <kx@radix.pro>2023-03-24 03:51:10 +0300
committerkx <kx@radix.pro>2023-03-24 03:51:10 +0300
commit05d292b208dfe01324826b4c87bbc4da3389a0d5 (patch)
treeb10a2269e9320785f3b61189e75f6778fa167986 /auto-clean
parent40ab18a661ff6ada40e73969be293918d346a2f5 (diff)
downloadcgit-ui-05d292b208dfe01324826b4c87bbc4da3389a0d5.tar.xz
Version 0.1.7
Diffstat (limited to 'auto-clean')
-rwxr-xr-xauto-clean40
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}