From abe9562a24a2e8fff13af310ef7d6164202350fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 19 Jan 2022 14:46:50 +0800 Subject: [PATCH] Fix path separators, create appdata_dst_path and check file operation return value (#321) * Fix path separator * Apply suggestion * format * Apply suggestions * Apply suggestion * Apply suggestion --- src/vcpkg/commands.integrate.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vcpkg/commands.integrate.cpp b/src/vcpkg/commands.integrate.cpp index 1d2d5883ef..be9d35b543 100644 --- a/src/vcpkg/commands.integrate.cpp +++ b/src/vcpkg/commands.integrate.cpp @@ -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 @@ -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); @@ -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) {