From 2d6f9a788f2195009d60744f130f53c2ba037a01 Mon Sep 17 00:00:00 2001 From: serr Date: Sun, 13 Apr 2025 16:59:05 +0300 Subject: [PATCH] some changes --- eye.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eye.sh b/eye.sh index 9a70efc..a0ef025 100755 --- a/eye.sh +++ b/eye.sh @@ -15,16 +15,16 @@ CLEANUP_DONE=0 # Вывод в синем цвете blue() { - echo -e "\033[34m$1\033[0m" + echo -e "\033[34mEYE | $1\033[0m" } # Очистка при завершении работы скрипта cleanup() { [ $CLEANUP_DONE -eq 1 ] && exit 0 - blue "EYE | cleanup..." + blue "cleanup..." kill_proc $1 rm -f $BINARY_PATH - blue "EYE | see you later!" + blue "see you later!" CLEANUP_DONE=1 exit 0 } @@ -34,7 +34,7 @@ kill_proc() { local pid=$1 if [ -n "$pid" ] && kill -0 $pid 2>/dev/null; then kill $pid - blue "EYE | process killed (PID: $pid)" + blue "process killed (PID: $pid)" fi } @@ -60,7 +60,7 @@ check_changes() { changed=1 LAST_MODS["$target"]=$current_mod LAST_COUNTS["$target"]=$current_count - [ -n "$1" ] && blue "EYE | changes detected in \033[94m$target\033[0m" + [ -n "$1" ] && blue "changes detected in \033[94m$target\033[0m" fi done @@ -83,23 +83,23 @@ main() { LAST_MODS["$target"]=0 LAST_COUNTS["$target"]=$(find "$target" -type f 2>/dev/null | wc -l) fi - blue "EYE | started watching \033[94m$target\033[0m" + blue "started watching \033[94m$target\033[0m" done # Основной цикл работы скрипта while true; do check_changes $pid if [ $? -eq 1 ]; then - blue "EYE | rebuilding..." + blue "rebuilding..." $BUILD_CMD if [ $? -eq 0 ]; then - blue "EYE | build successful. restarting..." + blue "build successful. restarting..." kill_proc $pid $BINARY_PATH & pid=$! - blue "EYE | started new process (PID: $pid)" + blue "started new process (PID: $pid)" else - blue "EYE | build failed" + blue "build failed" fi fi