aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_import.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/commands_import.cpp')
-rw-r--r--toolsrc/src/commands_import.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp
index 1fcc3b3a8..b65f636eb 100644
--- a/toolsrc/src/commands_import.cpp
+++ b/toolsrc/src/commands_import.cpp
@@ -72,13 +72,14 @@ namespace vcpkg::Commands::Import
static void do_import(const VcpkgPaths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data)
{
+ auto& fs = paths.get_filesystem();
fs::path library_destination_path = paths.package_dir(control_file_data.spec);
std::error_code ec;
- paths.get_filesystem().create_directory(library_destination_path, ec);
+ fs.create_directory(library_destination_path, ec);
place_library_files_in(paths.get_filesystem(), include_directory, project_directory, library_destination_path);
fs::path control_file_path = library_destination_path / "CONTROL";
- std::ofstream(control_file_path) << control_file_data;
+ fs.write_contents(control_file_path, Strings::serialize(control_file_data));
}
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)