make nixpkgs git detection a wee bit more precise

This commit is contained in:
Jörg Thalheim 2019-10-18 12:37:54 +00:00
parent 983f7b8154
commit ea257f1130

View file

@ -3,7 +3,7 @@ use_nix() {
if [ -f "${path}/.version-suffix" ]; then if [ -f "${path}/.version-suffix" ]; then
local version="$(< $path/.version-suffix)" local version="$(< $path/.version-suffix)"
elif [ -d "${path}/.git" ]; then elif [ -f "${path}/.git/HEAD" ]; then
local head=$(< ${path}/.git/HEAD) local head=$(< ${path}/.git/HEAD)
local regex="ref: (.*)" local regex="ref: (.*)"
if [[ "$head" =~ $regex ]]; then if [[ "$head" =~ $regex ]]; then