crane/ci/ref-from-lock.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
332 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
nixpkgsFrom="${1:?missing nixpkgsFrom}"
flakeLock="$(echo "${nixpkgsFrom}" | cut -d# -f1)"
input="$(echo "${nixpkgsFrom}" | cut -d# -f2)"
jq -r <"${flakeLock}/flake.lock" '.nodes.root.inputs."'"${input}"'" as $name | .nodes | getpath([$name]).locked | "\(.type):\(.owner)/\(.repo)/\(.rev)"'