My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/development/ruby-modules/bundler-update-script/default.nix

25 lines
614 B

{ 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 ]