Pr fix build template#573
Conversation
| local engine_dir=$1 | ||
| local platform=$2 | ||
| local template_dir=$3 | ||
| local engine_dir="$ENGINE_DIR" |
There was a problem hiding this comment.
note: Possible misspelling: ENGINE_DIR may not be assigned. Did you mean engine_dir? [SC2153]
Details
lint 解释
这个lint结果提示你在脚本中可能拼写错误,ENGINE_DIR 可能没有被正确赋值。建议你检查是否应该使用 engine_dir 而不是 ENGINE_DIR。
错误用法
if [ -z "$ENGINE_DIR" ]; then
echo "ENGINE_DIR is not set"
fi正确用法
if [ -z "$engine_dir" ]; then
echo "engine_dir is not set"
fi💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| local template_dir=$3 | ||
| local engine_dir="$ENGINE_DIR" | ||
| local platform=$1 | ||
| local template_dir="$TEMPLATE_DIR" |
There was a problem hiding this comment.
note: Possible misspelling: TEMPLATE_DIR may not be assigned. Did you mean template_dir? [SC2153]
Details
lint 解释
这个lint结果提示在代码中可能有一个拼写错误。具体来说,TEMPLATE_DIR 可能没有被赋值,建议检查是否应该是 template_dir。
错误用法
TEMPLATE_DIR=/path/to/template正确用法
template_dir=/path/to/template💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| @@ -168,7 +168,7 @@ build_editor(){ | |||
| prepare_env | |||
| cd $ENGINE_DIR | |||
There was a problem hiding this comment.
warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. [SC2164]
Details
lint 解释
这个lint结果表明在脚本中使用了cd ...命令,但没有处理可能的失败情况。如果cd命令执行失败,脚本将继续执行后续的命令,这可能会导致意外的行为。
错误用法
cd /path/to/directory
# 如果 cd 失败,脚本会继续执行
echo "Directory changed"正确用法
cd /path/to/directory || exit 1
# 或者
cd /path/to/directory || return 1
# 如果 cd 失败,脚本会退出或返回错误码
echo "Directory changed"💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
| build_template "$ENGINE_DIR" "$PLATFORM" "$TEMPLATE_DIR" || exit | ||
| build_template "$PLATFORM" || exit | ||
| fi | ||
| cd $PROJ_DIR |
There was a problem hiding this comment.
warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. [SC2164]
Details
lint 解释
这个lint结果表明在脚本中使用了cd ...命令,但没有处理可能的失败情况。如果cd命令执行失败,脚本将继续执行后续的命令,这可能会导致意外的行为。
错误用法
cd /path/to/directory
# 如果 cd 失败,脚本会继续执行
echo "Directory changed"正确用法
cd /path/to/directory || exit 1
# 或者
cd /path/to/directory || return 1
# 如果 cd 失败,脚本会退出或返回错误码
echo "Directory changed"💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
No description provided.