-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathchangelog.sh
executable file
·73 lines (52 loc) · 1.99 KB
/
changelog.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# @param string SVNURL
# Variables List
TITLE=$(head -n1 changelog.txt)
LICENSE=$(cat changelog.txt | grep "License URI:" | awk -F// '{ print $2 }' | cat changelog.txt | grep "License URI:" | cut -d: -f2,3)
#echo $TITLE $LICENSE
# Remove Previous Files
if [ -e /tmp/file ] || [ -e /tmp/file1 ] || [ -e /tmp/file2 ]
then
rm /tmp/file* &> /dev/null
fi
# Add Images
#curl -I $1/assets/banner-772x250.png 2> /dev/null | grep '200 OK' &> /dev/null
#if [ $? -eq 0 ]
#then
# echo "" &> /tmp/file
# echo >> /tmp/file
#fi
#curl -I $1/assets/banner-772x250.jpg 2> /dev/null | grep '200 OK' &> /dev/null
#if [ $? -eq 0 ]
#then
# echo "" &> /tmp/file
# echo >> /tmp/file
#fi
#curl -I $1/assets/banner-772x250.jpeg 2> /dev/null | grep '200 OK' &> /dev/null
#if [ $? -eq 0 ]
#then
# echo "" &> /tmp/file
# echo >> /tmp/file
#fi
# Send All The Line Except The Lines All Ready Present in Temp File
cat changelog.txt >> /tmp/file
# Delete Unwanted Stuff
sed '/^Tags:/,/^Stable tag:/d' /tmp/file &>/tmp/file1
sed '/^== Upgrade/,/$/d' /tmp/file1 &> /tmp/file2
# Add New Line (Needed To Proper Solutions)
#sed -i '/Donate/ i\License: [GPLv2 or later] (http://www.gnu.org/licenses/gpl-2.0.html)' /tmp/file2
# Add New Lines For Line Breaks In Github
sed 's/Contributors/\'$'\n&/g' /tmp/file2 &> /tmp/file1
sed 's/License/\'$'\n&/g' /tmp/file1 &> /tmp/file2
sed 's/Donate/\'$'\n&/g' /tmp/file2 &> /tmp/file1
# Replace === to #
sed 's/===/#/g' /tmp/file1 &> /tmp/file2
# REplace == to ##
sed 's/==/##/g' /tmp/file2 &> /tmp/file1
# Replave = to #### From Description To The End Of File
#sed 's/^= /# /g' /tmp/file1 &> /tmp/file2
#sed 's/ =/ #/g' /tmp/file2 &> /tmp/file1
# Make Text Bold
sed 's/[Cc]ontributors:/* **Contributors:**/' /tmp/file2 &> /tmp/file1
sed 's/[Dd]onate [Ll]ink:/* **Donate Link:**/' /tmp/file1 &> /tmp/file2
sed 's/[Ll]icense:/* **License:**/' /tmp/file2 &> CHANGELOG.md