mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
Update src/nix/prefetch.cc
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit 05381c0b30
)
This commit is contained in:
parent
73f3179954
commit
d58592469d
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ std::tuple<StorePath, Hash> prefetchFile(
|
||||||
/* If the archive unpacks to a single file/directory, then use
|
/* If the archive unpacks to a single file/directory, then use
|
||||||
that as the top-level. */
|
that as the top-level. */
|
||||||
tmpFile = entries->path();
|
tmpFile = entries->path();
|
||||||
unsigned fileCount = std::distance(entries, std::filesystem::directory_iterator{});
|
auto fileCount = std::distance(entries, std::filesystem::directory_iterator{});
|
||||||
if (fileCount != 1) {
|
if (fileCount != 1) {
|
||||||
/* otherwise, use the directory itself */
|
/* otherwise, use the directory itself */
|
||||||
tmpFile = unpacked;
|
tmpFile = unpacked;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue