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

use createDirs consistently everywhere

(cherry picked from commit a8217f2642)
This commit is contained in:
Jörg Thalheim 2025-03-12 17:49:45 +01:00 committed by Mergify
parent ceec04f1e2
commit d1fe15f43f
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);
}
try {
fs::create_directories(out);
} catch (fs::filesystem_error &) {
throw SysError("creating directory '%1%'", out.string());
}
createDirs(out);
unpackTarfile(src, out);

View file

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

View file

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