aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_integration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/commands_integration.cpp')
-rw-r--r--toolsrc/src/commands_integration.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integration.cpp
index 178d40e83..6a11d6ec4 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 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)
{
@@ -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);
@@ -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")
{