depot/third_party/nixpkgs/pkgs/development/ruby-modules/bundler-update-script/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

26 lines
668 B
Nix

{ runtimeShell, lib, writeScript, bundix, bundler, coreutils, git, nix }:
attrPath:
let
updateScript = writeScript "bundler-update-script" ''
#!${runtimeShell}
PATH=${lib.makeBinPath [ bundler bundix coreutils git nix ]}
set -o errexit
set -o nounset
set -o pipefail
attrPath=$1
toplevel=$(git rev-parse --show-toplevel)
position=$(nix --extra-experimental-features nix-command eval -f "$toplevel" --raw "$attrPath.meta.position")
gemdir=$(dirname "$position")
cd "$gemdir"
rm -f gemset.nix Gemfile.lock
export BUNDLE_FORCE_RUBY_PLATFORM=1
bundler lock --update
bundix
'';
in [ updateScript attrPath ]