3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ruby-modules/bundler-update-script/default.nix
2019-07-22 12:02:47 +00:00

26 lines
614 B
Nix

{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix }:
attrPath:
let
updateScript = writeScript "bundler-update-script" ''
#!${runtimeShell}
PATH=${lib.makeBinPath [ bundler bundler-audit bundix coreutils git nix ]}
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 ]