From bcf0f180061d2c07298fea713245f35d1294d7eb Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 11 May 2025 21:48:15 +1200 Subject: [PATCH] better. --- src/utils/execute.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 += "'";