Export engine to igox , update igox build tool#665
Merged
JiepengTan merged 1 commit intogoplus:devfrom May 22, 2025
Merged
Conversation
| @@ -1,9 +1,10 @@ | |||
| #!/bin/bash | |||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |||
| cd $SCRIPT_DIR | |||
Contributor
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"在这个示例中,如果/path/to/directory不存在或无法访问,脚本将继续执行并输出"Directory changed",这可能会导致错误。
正确用法
cd /path/to/directory || exit 1
# 或者
cd /path/to/directory || return 1
echo "Directory changed"在这个示例中,如果cd命令失败,脚本将立即退出(使用exit 1)或返回一个非零状态码(使用return 1),从而避免继续执行后续的命令。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
nighca
approved these changes
May 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix Failed to resolve package import xxxx
