-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdepiction.sh
More file actions
executable file
·47 lines (37 loc) · 1.02 KB
/
depiction.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.02 KB
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
Version=$1
depictionFile="/var/mobile/tweaks/mine/repo/depic/420Tools.html"
depictionFind="<!--Release-Version-->"
depictionCodeOpen="<p><b><center>Version: "
depictionCodeClose="</center></b></p>"
depictionBugFind="<!--BUGS-->"
depictionBugCodeOpen=""
depictionBugCodeClose=""
updateLines(){
file=$1
shift 1
findMe=$1
shift 1
openCode=$1
shift 1
closeCode=$1
shift 1
insert=$1
findAndReplace=$(sed -n "/^$findMe/p" $file)
replaceWith="$findMe$openCode$insert$closeCode"
# sed "/$findAndReplace/ { c \\$replaceWith
#}" $file
sed -i "s|$findAndReplace|$replaceWith|" $file
}
bugs=$(cat bugs.txt)
bugs=$(echo "${bugs//$'\n'/<br>• }")
bugs=$(echo "$bugs" | sed "s/^/• /g")
if [[ $Version != "" ]]; then
updateLines "$depictionFile" "$depictionFind" "$depictionCodeOpen" "$depictionCodeClose" "$Version"
#updateVersion $control $controlFind
else
echo "fuuuuuuuuuuuuuuuuuck you"
fi
if [[ $bugs != "" ]]; then
updateLines "$depictionFile" "$depictionBugFind" "$depictionBugCodeOpen" "$depictionBugCodeClose" "$bugs"
fi