2022-12-17 10:02:37 +00:00
|
|
|
{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
attrPath:
|
|
|
|
|
|
|
|
let
|
|
|
|
updateScript = writeScript "bundler-update-script" ''
|
|
|
|
#!${runtimeShell}
|
2022-12-17 10:02:37 +00:00
|
|
|
PATH=${lib.makeBinPath [ bundler bundler-audit 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
|
|
|
|
bundler-audit check --update
|
|
|
|
bundix
|
|
|
|
'';
|
|
|
|
in [ updateScript attrPath ]
|