mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-01-01 14:44:48 +01:00
Adapt update script to avoid downloading again and reuse release files
This commit is contained in:
parent
ec4259c0fd
commit
a0b37e8084
1 changed files with 4 additions and 3 deletions
|
@ -2,19 +2,20 @@
|
|||
|
||||
set -e
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "usage: $0 VERSION"
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "usage: $0 VERSION RELEASE_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
release_directory="$2"
|
||||
file="share/ruby-build/truffleruby-${version}"
|
||||
|
||||
add_platform() {
|
||||
platform="$1"
|
||||
basename="truffleruby-${version}-${platform}.tar.gz"
|
||||
url="https://github.com/oracle/truffleruby/releases/download/vm-${version}/${basename}"
|
||||
sha256=$(curl -L "$url" | sha256sum | cut -d ' ' -f 1)
|
||||
sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1)
|
||||
|
||||
cat >> "$file" <<EOS
|
||||
install_package "truffleruby-${version}" "${url}#${sha256}" truffleruby
|
||||
|
|
Loading…
Reference in a new issue