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
9 changes: 8 additions & 1 deletion script/update-cruby
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ else
exit 1
fi

major_version=$(echo ${version} | cut -d '.' -f 1)
if [ "$major_version" -ge 4 ]; then
Comment on lines +39 to +40
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

major_version=$(echo ${version} | cut -d '.' -f 1) introduces an unquoted expansion and relies on echo, which can mis-handle values starting with - and will trigger ShellCheck warnings (SC2086). Prefer a safer/cheaper parse (e.g., parameter expansion like ${version%%.*} or cut with a quoted here-string) so the major version extraction can’t be affected by word-splitting/echo semantics.

Copilot uses AI. Check for mistakes.
needs_openssl="needs_openssl:1.1.1-3.x.x"
else
needs_openssl="needs_openssl:1.0.2-3.x.x"
fi

cat > "$file" <<EOS
install_package "openssl-${openssl_version}" "${openssl_url}#${openssl_sha256}" openssl --if needs_openssl:1.0.2-3.x.x
install_package "openssl-${openssl_version}" "${openssl_url}#${openssl_sha256}" openssl --if ${needs_openssl}
install_package "ruby-${version}" "${url}#${sha256}" enable_shared standard
EOS
Loading