1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs/build-support/fetchgitlocal/default.nix

11 lines
276 B
Nix

{ 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
''