forked from Lanchon/Flashize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-readme
executable file
·70 lines (53 loc) · 1.91 KB
/
make-readme
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
#!/bin/bash
set -e
#set -o pipefail
printLine() {
line="$1"
if [ "${line::7}" == "Usage: " ]; then
echo "\`$tool ${line:7}\`"
else
line="$(echo "$line" | sed 's/[\<]/\`\</g')"
line="$(echo "$line" | sed 's/[\>]/\>\`/g')"
line="$(echo "$line" | sed 's/^ -/- /g')"
line="$(echo "$line" | sed 's/^ / /g')"
echo "$line"
fi
}
printUsage() {
tool="$1"
#echo "---------------------------------------------------------------------------------------------------"
echo "<br>"
echo
echo "#### Usage: ${tool^^}"
echo
./$tool 2>&1 | (
IFS=""
while read -r line; do
printLine "$line";
done
)
}
{
cat <<"EOF"
## Flashize
### Turn Shell Scripts Into Flashable Android Recovery Zips
#### Features
- Automatically convert shell scripts to flashable zips with a single command.
- Don't mess with `ui_print` crap: standard output and error streams will work just fine.
- Can add binaries to or otherwise alter the runtime environment offered by the recovery.
- Flip Toybox the bird: includes ready-to-go Busybox binaries for various architectures.
<br>(Binaries borrowed from [busybox.net] (https://www.busybox.net).)
- Can automatically extract resources from the zipfile before invoking the script.
- Can automatically create a logfile of the output of the script.
- Displays (and possibly logs) the script exit code and reports it back to recovery.
- The script receives the path of the zipfile being flashed as its first parameter.
<br>(Other parameters reserved for future use.)
- Supports various debugging modes for runtime script tracing.
- Flashize requires Bash shell. It is developed and tested under Linux.
- Flashize is free software published under GPL and LGPL version 3 and later licenses.
EOF
printUsage flashize
printUsage flashize-ext
printUsage flashize-ebb
printUsage flashize-env
} >README.md