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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user