diff --git a/juci/config.cc b/juci/config.cc index 8d54a65..727e2ce 100644 --- a/juci/config.cc +++ b/juci/config.cc @@ -31,9 +31,13 @@ void MainConfig::GenerateSource() { void MainConfig::GenerateTerminalCommands() { boost::property_tree::ptree source_json = cfg_.get_child("project"); - boost::property_tree::ptree commands_json = source_json.get_child("compile_commands"); - for (auto &i : commands_json) { - terminal_cfg_.InsertCompileCommand(i.second.get_value()); + boost::property_tree::ptree compile_commands_json = source_json.get_child("compile_commands"); + boost::property_tree::ptree run_commands_json = source_json.get_child("run_commands"); + for (auto &i : compile_commands_json) { + terminal_cfg_.InsertCompileCommand(i.second.get_value()); + } + for (auto &i : run_commands_json) { + terminal_cfg_.SetRunCommand(i.second.get_value()); } } diff --git a/juci/config.json b/juci/config.json index 09cb5a2..ca3fa5c 100644 --- a/juci/config.json +++ b/juci/config.json @@ -57,10 +57,12 @@ ] }, "project": { - + "run_commands": [ + "./.build/" + ], "compile_commands": [ "rm -rf ./.build", - "mkdir build", + "mkdir ./.build", "cmake -B./.build -H.", "cd ./.build/; make" ] diff --git a/juci/terminal.cc b/juci/terminal.cc index 45670d2..00c7004 100644 --- a/juci/terminal.cc +++ b/juci/terminal.cc @@ -6,7 +6,8 @@ Terminal::Config::Config() { } -Terminal::Config::Config(Terminal::Config& original) { +Terminal::Config::Config(Terminal::Config& original) : + run_command_(original.run_command_){ for (auto it = 0; it