container: plugins: root: fix example3()'s shell

The spawned shell needs its sourced environment and aliases.

Resolves:

  sh: line 1: dfi: command not found
  Error in <TRint::HandleTermInput()>: std::runtime_error caught:
          FILE = "/home/business/docker-finance/plugins/root/example.cc"
          LINE = 125
          WHAT = "command failed"
This commit is contained in:
2025-10-21 21:45:14 -07:00
parent a8a9d915c3
commit 9735317ae8

View File

@@ -122,7 +122,10 @@ void example3()
auto exec_cmd = [&make_cmd](const std::string& cmd) {
// shell 0 = success
THROW_IF(common::exec(make_cmd(cmd)), std::runtime_error, "command failed")
THROW_IF(
common::exec("bash -i -c '" + make_cmd(cmd) + "'"),
std::runtime_error,
"command failed")
};
std::cout << "\nImporting journals...\n";