-
Notifications
You must be signed in to change notification settings - Fork 0
/
send_comments.sh
executable file
·48 lines (39 loc) · 1.57 KB
/
send_comments.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash -x
SELF="$0" ; test "X${SELF}" = "X" && exit 2
DIR=`dirname ${SELF}`
BASE=`basename ${SELF}`
cd ${DIR}/ || exit 9
export CWD=`pwd`
##RDY2SND=`find MESGS -type f -mtime +24h`
RDY2SND=`find MESGS -type f`
test "X${RDY2SND}" = "X" && exit 10
####NEWDONES=`cat MESGS/*|grep -v -i merge|sort -u|grep "[A-Z,a-z,0-9]"`
####test "X${NEWDONES}" = "X" && exit 10
mkdir -p ./logs.git
test -d ./logs.git/.git || git init logs.git
cat repos/.did/.git/config > ./logs.git/.git/config
ALREADYSENTTODAY=`git --git-dir=logs.git/.git log --format=%s --author=sstecker --since=12am`
test "X${ALREADYSENTTODAY}" != "X" && {
echo "${ALREADYSENTTODAY}"|while read line ; do
clean=`echo "${line}"|perl -p -e 's|\@|\\\@|g'|perl -p -e 's|\?|\\\?|g'|perl -p -e 's|\(|\\\(|g'|perl -p -e 's|\)|\\\)|g'|perl -p -e 's#\|#\\\|#g'|perl -p -e 's|\[|\\\[|g'|perl -p -e 's|\]|\\\]|g'|perl -p -e 's|\.|\\\.|g'|perl -p -e 's|\*|\\\*|g'|perl -p -e 's|(\\$)|\\\\\1|g'|perl -p -e 's|\+|\\\+|g'`
perl -p -i -e "s|^${clean}\n||g" MESGS/*
done
}
##exit
NEWDONES=`cat MESGS/*|grep -v -i merge|sort -u|grep "[A-Z,a-z,0-9]"`
test "X${NEWDONES}" != "X" && {
echo "${NEWDONES}"|while read line ; do
true && {
clean=`echo "${line}"|perl -p -e 's|\@|\\\@|g'`
perl -p -i -e "s|^${clean}\n||g" MESGS/*
echo "${line}" > logs.git/DIDS
cd logs.git || exit 19
git add DIDS
git commit -m "${line}" DIDS
cd "${CWD}" || exit 23
}
done
}
cd "${CWD}" || exit 29
EMPTYFILES=`grep -L "[A-Z,a-z,0-9]" MESGS/*`
test "X${EMPTYFILES}" != "X" && rm -f ${EMPTYFILES}