diff --git a/src/utils/execute.cpp b/src/utils/execute.cpp index 3353e28..6a3f367 100644 --- a/src/utils/execute.cpp +++ b/src/utils/execute.cpp @@ -139,14 +139,15 @@ std::string sCommand::construct_cmd(cStyle style) const return ""; std::string cmdstr; + cmdstr += "bash -c '"; + + if (!mDir.empty()) + cmdstr += "cd " + quote(mDir) + " && "; + for (const auto& env_var : mVars) { cmdstr += env_var.first + "=" + quote(dequote(trim(env_var.second))) + " "; } - cmdstr += "bash -c '"; - if (!mDir.empty()) - cmdstr += "cd " + quote(mDir) + " && "; - cmdstr += mCmd; cmdstr += "'";