Skip to content

Commit

Permalink
[vcpkg-export] Fix nuget export. Fixes #1223.
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Jun 22, 2017
1 parent a9baf1d commit 8461bc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions toolsrc/src/commands_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
3 changes: 2 additions & 1 deletion toolsrc/src/vcpkg_Files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8461bc1

Please sign in to comment.