File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,22 @@ create_applist() {
77
77
# base description
78
78
string=" description=WebUI-based debloater and whiteout creator"
79
79
80
- # count nuked apps
81
- total=$( grep -c ' "package_name":' " $REMOVE_LIST " )
82
- string=" $string | 💥 nuked: $total app$( [ " $total " -lt 2 ] && echo ' ' || echo ' s' ) "
80
+ # count nuked apps (fallback to 0 if file missing or grep fails)
81
+ if [ -f " $REMOVE_LIST " ]; then
82
+ total=$( grep -c ' "package_name":' " $REMOVE_LIST " )
83
+ else
84
+ total=0
85
+ fi
86
+
87
+ # fallback if grep somehow returns blank
88
+ [ -z " $total " ] && total=0
89
+
90
+ # pluralize
91
+ suffix=" "
92
+ [ " $total " -ne 1 ] && suffix=" s"
93
+
94
+ # add nuked app count
95
+ string=" $string | 💥 nuked: $total app$suffix "
83
96
84
97
# detect mount mode
85
98
if [ " $use_mountify_script " = true ]; then
88
101
string=" $string | ⚙️ mount mode: default"
89
102
fi
90
103
91
- # set module desc
92
- sed -i " s/^description=.*/$string /g" $MODDIR /module.prop
104
+ # set module description
105
+ sed -i " s/^description=.*/$string /g" " $MODDIR /module.prop"
93
106
94
107
# wait for boot completed
95
108
until [ " $( getprop sys.boot_completed) " = " 1" ]; do
You can’t perform that action at this time.
0 commit comments