mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-25 02:27:25 +00:00
scripts: touch up print_title
- stars aren't pounds, let's just call it a title bar :P
This commit is contained in:
parent
18065826b9
commit
ff3f377911
@ -72,17 +72,17 @@ resolve_vars() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_title() {
|
print_title() {
|
||||||
local len line1len line2len pounds
|
local len line1len line2len bar
|
||||||
line1len=$(echo -n $1 | wc -c)
|
line1len=$(echo -n $1 | wc -c)
|
||||||
line2len=$(echo -n $2 | wc -c)
|
line2len=$(echo -n $2 | wc -c)
|
||||||
len=$line2len
|
len=$line2len
|
||||||
[ $line1len -gt $line2len ] && len=$line1len
|
[ $line1len -gt $line2len ] && len=$line1len
|
||||||
len=$((len + 2))
|
len=$((len + 2))
|
||||||
pounds=$(printf "%${len}s" | tr ' ' '*')
|
bar=$(printf "%${len}s" | tr ' ' '*')
|
||||||
ui_print "$pounds"
|
ui_print "$bar"
|
||||||
ui_print " $1 "
|
ui_print " $1 "
|
||||||
[ "$2" ] && ui_print " $2 "
|
[ "$2" ] && ui_print " $2 "
|
||||||
ui_print "$pounds"
|
ui_print "$bar"
|
||||||
}
|
}
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user