Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ APP_LOG="$PROJECT_ROOT/application.log"
ERROR_LOG="$PROJECT_ROOT/error.log"
DEPLOY_LOG="$PROJECT_ROOT/deploy.log"

cd $PROJECT_ROOT
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

cd 실패 시 무조건 다음 단계로 진행되어 배포가 실패할 수 있음

cd $PROJECT_ROOT 명령이 실패해도 스크립트가 계속 실행되어 잘못된 경로에서 cp / java -jar가 수행될 위험이 있습니다.
ShellCheck 경고(SC2164)도 동일한 문제를 지적합니다. 실패 시 즉시 종료하도록 수정해 주세요.

-cd $PROJECT_ROOT
+cd "$PROJECT_ROOT" || {
+  echo "프로젝트 루트($PROJECT_ROOT)로 이동하지 못했습니다." >&2
+  exit 1
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd $PROJECT_ROOT
cd "$PROJECT_ROOT" || {
echo "프로젝트 루트($PROJECT_ROOT)로 이동하지 못했습니다." >&2
exit 1
}
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 26-26: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In scripts/start.sh at line 26, the cd command to $PROJECT_ROOT may fail but the
script continues running, risking subsequent commands running in the wrong
directory. Modify the script to check if cd succeeds and immediately exit if it
fails, ensuring the deployment does not proceed on an incorrect path.


TIME_NOW=$(date +%c)

# build 파일 복사
Expand Down