direnvrc: Fix reading of nixpkgs version from git checkout

This commit is contained in:
Moritz Heidkamp 2020-12-21 15:29:26 +01:00
parent 003dd8b808
commit 19372436ef

View file

@ -114,7 +114,7 @@ use_nix() {
read -r head < "${path}/.git/HEAD" read -r head < "${path}/.git/HEAD"
local regex="ref: (.*)" local regex="ref: (.*)"
if [[ "$head" =~ $regex ]]; then if [[ "$head" =~ $regex ]]; then
read -r version < ".git/${BASH_REMATCH[1]}" read -r version < "${path}/.git/${BASH_REMATCH[1]}"
else else
version="$head" version="$head"
fi fi