Skip to content

Commit 1c9fa76

Browse files
authored
perf(下载脚本): 删除文件夹改成清空文件, 尝试修复nginx部署白屏BUG (#56)
1 parent 6c709a4 commit 1c9fa76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

web-downloader/web-downloader.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ fi
3535

3636
# Unzip
3737
unzip "${TEAMCITY_BUILD_NAME}-${TEAMCITY_TAG}.zip"
38-
if [ -e "${NGINX_HTML_DIR_NAME}" ]; then
39-
rm -rf "${NGINX_HTML_DIR_NAME}"
38+
39+
# Clean up content inside the directory, but KEEP the directory itself
40+
# to avoid breaking Nginx Docker mounts/handles.
41+
if [ -d "${NGINX_HTML_DIR_NAME}" ]; then
42+
rm -rf "${NGINX_HTML_DIR_NAME:?}"/*
43+
else
44+
mkdir -p "${NGINX_HTML_DIR_NAME}"
4045
fi
46+
4147
unzip "${TEAMCITY_BUILD_ZIP_NAME}" -d "${NGINX_HTML_DIR_NAME}"
4248
cp_override_files
4349

0 commit comments

Comments
 (0)