1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Merge pull request #12767 from Mic92/fs-stuff-2

use createDirs consistently everywhere
This commit is contained in:
Robert Hensing 2025-03-28 15:53:33 +00:00 committed by GitHub
commit 1e60ebeea0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 8 deletions

View file

@ -23,11 +23,7 @@ void builtinUnpackChannel(
throw Error("channelName is not allowed to contain filesystem separators, got %1%", channelName); throw Error("channelName is not allowed to contain filesystem separators, got %1%", channelName);
} }
try { createDirs(out);
fs::create_directories(out);
} catch (fs::filesystem_error &) {
throw SysError("creating directory '%1%'", out.string());
}
unpackTarfile(src, out); unpackTarfile(src, out);

View file

@ -166,7 +166,7 @@ void unpackTarfile(Source & source, const fs::path & destDir)
{ {
auto archive = TarArchive(source); auto archive = TarArchive(source);
fs::create_directories(destDir); createDirs(destDir);
extract_archive(archive, destDir); extract_archive(archive, destDir);
} }
@ -174,7 +174,7 @@ void unpackTarfile(const fs::path & tarFile, const fs::path & destDir)
{ {
auto archive = TarArchive(tarFile); auto archive = TarArchive(tarFile);
fs::create_directories(destDir); createDirs(destDir);
extract_archive(archive, destDir); extract_archive(archive, destDir);
} }

View file

@ -905,7 +905,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
std::function<void(const SourcePath & from, const fs::path & to)> copyDir; std::function<void(const SourcePath & from, const fs::path & to)> copyDir;
copyDir = [&](const SourcePath & from, const fs::path & to) copyDir = [&](const SourcePath & from, const fs::path & to)
{ {
fs::create_directories(to); createDirs(to);
for (auto & [name, entry] : from.readDirectory()) { for (auto & [name, entry] : from.readDirectory()) {
checkInterrupt(); checkInterrupt();