3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/fetchgitlocal/default.nix

11 lines
276 B
Nix
Raw Normal View History

{ runCommand, git }: src:
runCommand "local-git-export" {} ''
cd ${toString src}
mkdir -p "$out"
for file in $(${git}/bin/git ls-files); do
mkdir -p "$out/$(dirname $file)"
cp -d $file "$out/$file" || true # don't fail when trying to copy a directory
done
''