-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmake_changelog_lineage15
executable file
·50 lines (41 loc) · 1.52 KB
/
make_changelog_lineage15
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
48
49
50
#!/bin/bash
# Path to changelog file
CHANGE_FILE=~/android/changelog-lineage15.html
# Path to root of CM project directory
CM_PROJECT_DIR=~/android/system/lineage-15.1
# Path to WireGuard submodule
WIREGUARD_DIR=kernel/samsung/msm8976/net/wireguard
## End Edit
PROJECT_LIST=$CM_PROJECT_DIR/.repo/project.list
NOW=$(date -u)
SINCE=$(date -u --date="$NOW - 5 day")
if [ -e "$PROJECT_LIST" ]; then
REPOS=$(cat "$PROJECT_LIST" | tr " " "\n")
REPOS+=$(echo -e "\n$WIREGUARD_DIR\n")
REPOS=$(echo -e "$REPOS" | sort)
else
echo "Project list not found. Run repo_sync command to generate project list. Exiting!"
exit
fi
rm "$CHANGE_FILE"
echo "<!DOCTYPE html><html><body style='background-color:#1C1B22; color:white;'><h2><b><u>From $SINCE to $NOW</u></b></h2><br>" > "$CHANGE_FILE"
for REPOPATH in $REPOS ; do
if [ ! "$REPOPATH" == "" ]; then
if [ -d "$CM_PROJECT_DIR"/"$REPOPATH" ]; then
cd "$CM_PROJECT_DIR"/"$REPOPATH"
GITOUT=$(git log HEAD --pretty="<li>%h (%cr) %s (%an)</li>" --since="5 days ago")
if [ ! "$GITOUT" == "" ]; then
echo "<font size="4"><b>$REPOPATH</b></font>" >> "$CHANGE_FILE"
echo '<ul style="list-style-type:square">' >> "$CHANGE_FILE"
echo "$GITOUT" >> "$CHANGE_FILE"
echo "</ul>" >> "$CHANGE_FILE"
fi
fi
fi
done
echo "</body></html>" >> "$CHANGE_FILE"
echo ""
echo "Most recent changes:"
echo ""
cat "$CHANGE_FILE" | grep -E 'hours ago|minutes ago|seconds ago' | sed 's/<br>//g' | sed 's/<\/li>//g' | sed 's/<li>//g'
echo ""