From f1b5857ca67daf3c7f78ded55bd295529ccbb255 Mon Sep 17 00:00:00 2001 From: "lucas.sproule" Date: Wed, 1 Nov 2023 15:46:40 -0400 Subject: [PATCH] added passing down arg to command in watch commnd --- src/Command/CommandDev.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Command/CommandDev.cpp b/src/Command/CommandDev.cpp index 73cbb6d..c07def4 100644 --- a/src/Command/CommandDev.cpp +++ b/src/Command/CommandDev.cpp @@ -120,6 +120,11 @@ namespace Command { ); const std::string command = "cmake ./build/ && make && ./build/" + ctx->build_dir + "/" + ctx->project_name + " " +command_args; #else + std::string command_args = std::accumulate( + args_vec.begin(), args_vec.end(), args_vec[0], + [](std::string a, std::string b) { return a + " " + b; } + ); + const std::string command = "cmake . && make && ./" + ctx->build_dir + "/" + ctx->project_name + " " + command_args; #endif system(command.c_str());