2022-12-02 08:20:57 +00:00
|
|
|
{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix_2_3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
attrPath:
|
|
|
|
|
|
|
|
let
|
|
|
|
updateScript = writeScript "bundler-update-script" ''
|
|
|
|
#!${runtimeShell}
|
2022-12-02 08:20:57 +00:00
|
|
|
PATH=${lib.makeBinPath [ bundler bundler-audit bundix coreutils git nix_2_3 ]}
|
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)
|
|
|
|
position=$(nix eval -f "$toplevel" --raw "$attrPath.meta.position")
|
|
|
|
gemdir=$(dirname "$position")
|
|
|
|
|
|
|
|
cd "$gemdir"
|
|
|
|
|
|
|
|
bundler lock --update
|
|
|
|
bundler-audit check --update
|
|
|
|
bundix
|
|
|
|
'';
|
|
|
|
in [ updateScript attrPath ]
|