Skip to content

Commit e209129

Browse files
committed
refactor: python/entrypoint.sh 형식 통일
1 parent af93e9e commit e209129

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

docker/python/entrypoint.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
#!/bin/bash
22

3-
rm -f main.* output.txt runtime_error.txt
3+
echo "▶ Python 실행 시작"
4+
5+
echo "📜 [main.py]"
6+
cat main.py || echo "⚠️ main.py 없음"
7+
echo
8+
9+
echo "📜 [input.txt]"
10+
cat input.txt || echo "⚠️ input.txt 없음"
11+
echo
412

513
python3 main.py < input.txt > output.txt 2> runtime_error.txt
6-
if [ $? -ne 0 ]; then
7-
echo "실행 에러:"
8-
[ -s runtime_error.txt ] && cat runtime_error.txt
9-
exit 1
10-
fi
14+
status=$?
15+
16+
echo "📄 [output.txt]"
17+
cat output.txt || echo "⚠️ output.txt 없음"
18+
echo
19+
20+
echo "❌ [runtime_error.txt]"
21+
cat runtime_error.txt || echo "⚠️ runtime_error.txt 없음"
22+
echo
23+
24+
# 성공했든 실패했든 결과 확인 후에 파일 삭제
25+
rm -f output.txt runtime_error.txt
1126

12-
[ -s output.txt ] && cat output.txt
27+
exit $status

0 commit comments

Comments
 (0)