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

use createDirs consistently everywhere
This commit is contained in:
Robert Hensing authored and GitHub committed 2025-03-28 15:53:33 +00:00
commit 1e60ebeea0
3 files changed
+4 -8

No files matched your search

+1 -5
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);
+2 -2
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);
}
+1 -1
View File
@@ -905,7 +905,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();