From a1d9468e6d2ac35e6195cf2a111212c4adc865a1 Mon Sep 17 00:00:00 2001 From: Dan Sarginson Date: Wed, 21 Sep 2016 19:31:36 -0700 Subject: Remove use of wildcard in integration installation dest path. This seemed to be used in order to stop XPATH blocking on the file/directory dialog. It was causing odd issues I mentioned in #62. Instead used "echo f" to assure XCOPY that we're dealing with files. Fixes #62. --- toolsrc/src/commands_integration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/src/commands_integration.cpp') diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index 178d40e83..4f3fdd20b 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -195,7 +195,7 @@ namespace vcpkg const fs::path sys_src_path = tmp_dir / "vcpkg.system.targets"; std::ofstream(sys_src_path) << create_system_targets_shortcut(); - const std::string param = Strings::format(R"(/c XCOPY "%s" "%s*" /Y > nul)", sys_src_path.string(), system_wide_targets_file.string()); + const std::string param = Strings::format(R"(/c echo f | XCOPY "%s" "%s" /Y > nul)", sys_src_path.string(), system_wide_targets_file.string()); elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); switch (user_choice) { -- cgit v1.2.3 From 1402262962f9f29faa1c611b78b793a389a13843 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 28 Sep 2016 12:22:12 -0700 Subject: [vcpkg] Fix user wide integration to avoid XCOPY due to locale-specific failures --- toolsrc/src/commands_integration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/src/commands_integration.cpp') diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index 4f3fdd20b..aa10e210b 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -195,7 +195,7 @@ namespace vcpkg const fs::path sys_src_path = tmp_dir / "vcpkg.system.targets"; std::ofstream(sys_src_path) << create_system_targets_shortcut(); - const std::string param = Strings::format(R"(/c echo f | XCOPY "%s" "%s" /Y > nul)", sys_src_path.string(), system_wide_targets_file.string()); + const std::string param = Strings::format(R"(/c mkdir "%s" & copy "%s" "%s" /Y > nul)", system_wide_targets_file.parent_path().string(), sys_src_path.string(), system_wide_targets_file.string()); elevation_prompt_user_choice user_choice = elevated_cmd_execute(param); switch (user_choice) { -- cgit v1.2.3 From 8ed88af8c9cf2ed2e6fd573b2cd5dc2b41b55625 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 29 Sep 2016 19:28:00 -0700 Subject: Rename wchar_t overload of Strings::format() to wformat() --- toolsrc/src/commands_integration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/src/commands_integration.cpp') diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index aa10e210b..743a57a70 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -238,7 +238,7 @@ namespace vcpkg exit(EXIT_SUCCESS); } - const std::wstring cmd_line = Strings::format(LR"(DEL "%s")", get_appdata_targets_path().native()); + const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", get_appdata_targets_path().native()); const int exit_code = System::cmd_execute(cmd_line); if (exit_code) { @@ -269,7 +269,7 @@ namespace vcpkg std::ofstream(nuspec_file_path) << create_nuspec_file(paths.root, nuget_id, nupkg_version); // Using all forward slashes for the command line - const std::wstring cmd_line = Strings::format(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); + const std::wstring cmd_line = Strings::wformat(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); const int exit_code = System::cmd_execute(cmd_line); -- cgit v1.2.3 From b2c1076aef280e7ebfd38845dfcb4d4b66cd45e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 30 Sep 2016 11:24:04 -0700 Subject: All commands now use the new functions for argument checking --- toolsrc/src/commands_integration.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'toolsrc/src/commands_integration.cpp') diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp index 743a57a70..6a11d6ec4 100644 --- a/toolsrc/src/commands_integration.cpp +++ b/toolsrc/src/commands_integration.cpp @@ -297,13 +297,9 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - if (args.command_arguments.size() != 1) - { - std::cout << "Commands:\n" << - INTEGRATE_COMMAND_HELPSTRING << - "\n"; - exit(EXIT_FAILURE); - } + static const std::string example = Strings::format("Commands:\n" + "%s", INTEGRATE_COMMAND_HELPSTRING); + args.check_exact_arg_count(1, example.c_str()); if (args.command_arguments[0] == "install") { -- cgit v1.2.3