diff --git a/src/commands.cpp b/src/commands.cpp index 61e6929..63d7f63 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -245,6 +245,9 @@ clipp::group build_command::do_group() (clipp::option("-n", "--new") >> clean_) % "deletes everything and starts from scratch", + (clipp::option("--keep-msbuild") >> keep_msbuild_) + % "don't terminate msbuild.exe instances after building", + (clipp::opt_values( clipp::match::prefix_not("-"), "task", tasks_)) % "tasks to run; specify 'super' to only build modorganizer " @@ -274,6 +277,9 @@ int build_command::do_run() else run_all_tasks(); + if (!keep_msbuild_) + terminate_msbuild(); + mob::gcx().info(mob::context::generic, "mob done"); return 0; } @@ -284,6 +290,14 @@ int build_command::do_run() } } +void build_command::terminate_msbuild() +{ + if (conf::dry()) + return; + + system("taskkill /im msbuild.exe /f > NUL"); +} + clipp::group list_command::do_group() { diff --git a/src/commands.h b/src/commands.h index a5ab6c0..c2cfb85 100644 --- a/src/commands.h +++ b/src/commands.h @@ -103,6 +103,9 @@ private: bool reextract_ = false; bool rebuild_ = false; bool clean_ = false; + bool keep_msbuild_ = false; + + void terminate_msbuild(); };