Skip to content

Commit

Permalink
Fix path separators, create appdata_dst_path and check file operation…
Browse files Browse the repository at this point in the history
… return value (#321)

* Fix path separator

* Apply suggestion

* format

* Apply suggestions

* Apply suggestion

* Apply suggestion
  • Loading branch information
JackBoosY authored Jan 19, 2022
1 parent 483cfe0 commit abe9562
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/vcpkg/commands.integrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32)
static Path get_appdata_targets_path()
{
return get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg/vcpkg.user.targets";
return get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg\\vcpkg.user.targets";
}
#endif
#if defined(_WIN32)
static Path get_appdata_props_path()
{
return get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg/vcpkg.user.props";
return get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg\\vcpkg.user.props";
}
#endif

Expand Down Expand Up @@ -246,8 +246,8 @@ namespace vcpkg::Commands::Integrate
{
std::error_code ec;
const auto tmp_dir = paths.buildsystems / "tmp";
fs.create_directory(paths.buildsystems, ec);
fs.create_directory(tmp_dir, ec);
fs.create_directory(paths.buildsystems, VCPKG_LINE_INFO);
fs.create_directory(tmp_dir, VCPKG_LINE_INFO);

integrate_install_msbuild14(fs, tmp_dir);

Expand All @@ -256,6 +256,9 @@ namespace vcpkg::Commands::Integrate
appdata_src_path, create_appdata_shortcut(paths.buildsystems_msbuild_targets), VCPKG_LINE_INFO);
auto appdata_dst_path = get_appdata_targets_path();

const auto vcpkg_appdata_local = get_appdata_local().value_or_exit(VCPKG_LINE_INFO) / "vcpkg";
fs.create_directory(vcpkg_appdata_local, VCPKG_LINE_INFO);

fs.copy_file(appdata_src_path, appdata_dst_path, CopyOptions::overwrite_existing, ec);
if (ec)
{
Expand Down

0 comments on commit abe9562

Please sign in to comment.