Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(composer): add checksum functionality #886

Merged
merged 1 commit into from
Apr 9, 2023
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 src/usr/local/buildpack/tools/v2/composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ function install_tool () {
local versioned_tool_path
local file

file=$(get_from_url "https://github.com/composer/composer/releases/download/${TOOL_VERSION}/composer.phar")
local checksum_file
local expected_checksum

checksum_file=$(get_from_url "https://getcomposer.org/download/${TOOL_VERSION}/composer.phar.sha256sum")
# get checksum from file
expected_checksum=$(grep "composer.phar" "${checksum_file}" | cut -d' ' -f1)

file=$(get_from_url "https://getcomposer.org/download/${TOOL_VERSION}/composer.phar" "composer.phar" "${expected_checksum}" "sha256sum" )

versioned_tool_path=$(create_versioned_tool_path)
create_folder "${versioned_tool_path}/bin"
Expand Down