bundler: add passthru.updateScript

This commit is contained in:
Anthony Roussel 2022-08-30 19:04:07 +02:00
parent e6c5f49c18
commit 6088bad88a

View file

@ -1,4 +1,4 @@
{ buildRubyGem, ruby }:
{ buildRubyGem, ruby, writeScript }:
buildRubyGem rec {
inherit ruby;
@ -8,6 +8,16 @@ buildRubyGem rec {
source.sha256 = "sha256-gJJ3vHzrJo6XpHS1iwLb77jd9ZB39GGLcOJQSrgaBHw=";
dontPatchShebangs = true;
passthru.updateScript = writeScript "gem-update-script" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts jq
set -eu -o pipefail
latest_version=$(curl -s https://rubygems.org/api/v1/gems/${gemName}.json | jq --raw-output .version)
update-source-version ${gemName} "$latest_version"
'';
postFixup = ''
sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
'';