3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/fetchgitrevision/default.nix
Karn Kallio 871b59c636 Remove semicolon causing evaluation error.
svn path=/nixpkgs/trunk/; revision=25354
2011-01-02 23:52:39 +00:00

11 lines
328 B
Nix

runCommand: git: repository: branch:
import (runCommand "head-revision"
{ buildInputs = [ git ];
dummy = builtins.currentTime;
}
''
rev=$(git ls-remote ${repository} | grep "refs/${branch}$" | awk '{ print $1 }')
echo "[ \"$rev\" ]" > $out
echo Latest revision in ${branch} is $rev
'')