[vcpkg-export] Fix nuget export. Fixes #1223.

This commit is contained in:
Robert Schumacher 2017-06-21 17:41:31 -07:00
parent a9baf1d5ac
commit 8461bc1913
2 changed files with 6 additions and 1 deletions

View File

@ -122,6 +122,10 @@ namespace vcpkg::Commands::Export
const std::string targets_redirect_content =
create_targets_redirect("../../scripts/buildsystems/msbuild/vcpkg.targets");
const fs::path targets_redirect = paths.buildsystems / "tmp" / "vcpkg.export.nuget.targets";
std::error_code ec;
fs.create_directories(paths.buildsystems / "tmp", ec);
fs.write_contents(targets_redirect, targets_redirect_content);
const std::string nuspec_file_content =

View File

@ -164,7 +164,8 @@ namespace vcpkg::Files
{
FILE* f = nullptr;
auto ec = _wfopen_s(&f, file_path.native().c_str(), L"wb");
Checks::check_exit(VCPKG_LINE_INFO, ec == 0);
Checks::check_exit(
VCPKG_LINE_INFO, ec == 0, "Error: Could not open file for writing: %s", file_path.u8string().c_str());
auto count = fwrite(data.data(), sizeof(data[0]), data.size(), f);
fclose(f);