Skip to content

Pr fix build template#573

Merged
JiepengTan merged 2 commits intogoplus:devfrom
JiepengTan:pr_fix_build_template
Apr 15, 2025
Merged

Pr fix build template#573
JiepengTan merged 2 commits intogoplus:devfrom
JiepengTan:pr_fix_build_template

Conversation

@JiepengTan
Copy link
Copy Markdown
Contributor

No description provided.

@JiepengTan JiepengTan requested a review from nighca April 14, 2025 12:15
local engine_dir=$1
local platform=$2
local template_dir=$3
local engine_dir="$ENGINE_DIR"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 辅助生成,如有疑问欢迎反馈交流

@JiepengTan JiepengTan merged commit 9f0f61e into goplus:dev Apr 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants