From 23cb3c71041da401d9391fee3ee8362294a77409 Mon Sep 17 00:00:00 2001 From: imnyang Date: Thu, 9 Jan 2025 22:15:21 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B9=83=ED=97=99=EC=97=91=EC=85=98=EB=A7=9E?= =?UTF-8?q?=EC=B6=A4=EC=84=9C=EB=B9=84=EC=8A=A4~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/run.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/run.sh b/app/run.sh index 1b144a8..3a165bf 100644 --- a/app/run.sh +++ b/app/run.sh @@ -1,28 +1,30 @@ -export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin -echo "Debug: Script started at $(date)" >> /code/app/temp/debug.log -echo "Debug: Current directory is $(pwd)" >> /code/app/temp/debug.log -echo "Debug: User is $(whoami)" >> /code/app/temp/debug.log -echo "Debug: Environment variables:" >> /code/app/temp/debug.log -env >> /code/app/temp/debug.log - -cd /code/app +#!/bin/bash # If doesn't have temp folder, create it if [ ! -d "temp" ]; then mkdir temp fi +echo "Debug: Script started at $(date)" >> ./temp/debug.log +echo "Debug: Current directory is $(pwd)" >> ./temp/debug.log +echo "Debug: User is $(whoami)" >> ./temp/debug.log +echo "Debug: Environment variables:" >> ./temp/debug.log +env >> ./temp/debug.log + +cd ${BOT_ROOT} + + # If doesn't have temp/cookies.json, create it -if [ ! -f "temp/cookies.json" ]; then - /code/app/venv/bin/python3 library/init-auth.py +if [ ! -f "./temp/cookies.json" ]; then + python3 library/init-auth.py fi # Set the log file name with the current date and time -log_file="temp/$(date +%Y%m%d-%H%M%S).log" +log_file="./temp/$(date +%Y%m%d-%H%M%S).log" # Run the Python script with or without --today and output to both the console and log file if [[ "$1" == "--today" ]]; then - /code/app/venv/bin/python3 run.py --today | tee "$log_file" + python3 run.py --today | tee "$log_file" else - /code/app/venv/bin/python3 run.py | tee "$log_file" + python3 run.py | tee "$log_file" fi