Skip to content

Commit 8713843

Browse files
fix: logger direcotry issue fixed
1 parent 5fc217a commit 8713843

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,20 @@ install_executable() {
381381

382382
# remove previous installation of cron jobs and SystemGuard
383383
remove_previous_installation() {
384-
log "Removing previous installation of $APP_NAME, if any..."
385384
if [ -d "$EXTRACT_DIR" ]; then
386385
rm -rf "$EXTRACT_DIR"
387386
log "Old installation removed."
387+
else
388+
log "No previous installation found."
388389
fi
389390

390-
log "Cleaning up previous cron jobs related to $APP_NAME..."
391391
if $crontab_cmd -l | grep -q "$CRON_PATTERN"; then
392392
$crontab_cmd -l | grep -v "$CRON_PATTERN" | $crontab_cmd -
393393
log "Old cron jobs removed."
394394
else
395395
log "No previous cron jobs found."
396396
fi
397+
397398
}
398399

399400
# Function to fetch the latest version of SystemGuard from GitHub releases

src/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from logging.handlers import RotatingFileHandler
33
import os
44

5-
5+
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
66
# Create a logs directory if it doesn't exist
7-
os.makedirs('logs', exist_ok=True)
7+
os.makedirs(os.path.join(ROOT_DIR, 'logs'), exist_ok=True)
88

99
# Log Formatter with datetime, log level, and message
1010
formatter = logging.Formatter(

0 commit comments

Comments
 (0)