Skip to content

Commit a606149

Browse files
committed
improve: simplify post-fs-data.sh log naming logic
* First we check if any DebugAssistant log is present instead of any file, making the first logic creation entirely out of the loop * After that we can remove the check for equals to "" or end of the files which was a leftover from the previous uncommitted while loop logic * Since we already confirmed a DebugAssistant log is present, we do not need to check if the loop is about to end and no logs were found Signed-off-by: TheSillyOk <priv.ld@proton.me>
1 parent 31d454b commit a606149

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

post-fs-data.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ function watch_logcat() {
2121
while [ ! ];do logcat;sleep 1;done > "$file_path" &
2222
}
2323

24-
LATEST=$(ls -t $SAVE_FOLDER | head -1)
25-
if [[ "$LATEST" != "" ]]; then
24+
FILES=$(ls "$SAVE_FOLDER" | grep 'DebugAssistant')
25+
if [[ "$FILES" != "" ]]; then
2626
index=1
2727
for f in "$SAVE_FOLDER"/; do
2828
LATEST=$(ls -t "$SAVE_FOLDER" | awk NR==$index)
29-
if [[ "$LATEST" == "" ]]; then
30-
prepare_file ""
31-
watch_logcat ""
32-
break
33-
fi
3429
if [[ "$LATEST" == "DebugAssistant.log" ]]; then
3530
prepare_file "-2"
3631
watch_logcat "-2"

0 commit comments

Comments
 (0)