2023-07-15 17:15:38 +00:00
|
|
|
{ runtimeShell, lib, writeScript, bundix, bundler, coreutils, git, nix }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
attrPath:
|
|
|
|
|
|
|
|
let
|
|
|
|
updateScript = writeScript "bundler-update-script" ''
|
|
|
|
#!${runtimeShell}
|
2023-07-15 17:15:38 +00:00
|
|
|
PATH=${lib.makeBinPath [ bundler bundix coreutils git nix ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
attrPath=$1
|
|
|
|
|
|
|
|
toplevel=$(git rev-parse --show-toplevel)
|
2022-12-17 10:02:37 +00:00
|
|
|
position=$(nix --extra-experimental-features nix-command eval -f "$toplevel" --raw "$attrPath.meta.position")
|
2020-04-24 23:36:52 +00:00
|
|
|
gemdir=$(dirname "$position")
|
|
|
|
|
|
|
|
cd "$gemdir"
|
|
|
|
|
|
|
|
bundler lock --update
|
|
|
|
bundix
|
|
|
|
'';
|
|
|
|
in [ updateScript attrPath ]
|