mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 14:32:42 +01:00
inline the usage of nix::readDirectory
`nix::readDirectory` is removed. `std::filesystem::directory_iterator` is used directly in places that used this util.
This commit is contained in:
parent
87ab3c0ea4
commit
1db7d1b840
18 changed files with 26 additions and 44 deletions
|
|
@ -21,10 +21,12 @@ void builtinUnpackChannel(
|
|||
|
||||
unpackTarfile(src, out);
|
||||
|
||||
auto entries = readDirectory(out);
|
||||
if (entries.size() != 1)
|
||||
auto entries = std::filesystem::directory_iterator{out};
|
||||
auto file_count = std::distance(entries, std::filesystem::directory_iterator{});
|
||||
|
||||
if (file_count != 1)
|
||||
throw Error("channel tarball '%s' contains more than one file", src);
|
||||
renameFile(entries[0].path().string(), (out + "/" + channelName));
|
||||
renameFile(entries->path().string(), (out + "/" + channelName));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue