depot/packages/tools/pin/pin.sh

17 lines
450 B
Bash
Raw Normal View History

2022-07-30 20:39:22 +03:00
REPO_ROOT="${REPO_ROOT:-.}"
NPINS_DIRECTORY="${NPINS_DIRECTORY:-npins}"
cmd="$1"
shift
case $cmd in
update)
for pkg in "$@"; do
oldver=$(nix eval --raw "${REPO_ROOT}#${pkg}.version")
npins update "$pkg"
newver=$(nix eval --raw "${REPO_ROOT}#${pkg}.version")
git add "${NPINS_DIRECTORY}"
git commit "${NPINS_DIRECTORY}" -m "packages/$pkg: $oldver -> $newver"
done;;
*)
echo Unknown command: "$cmd";;
esac