Skip to content
Snippets Groups Projects
Commit 50ce7e6b authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better

parent 07efddbd
No related branches found
No related tags found
No related merge requests found
...@@ -254,12 +254,14 @@ int SystemCall(const std::string &command, bool blocking) ...@@ -254,12 +254,14 @@ int SystemCall(const std::string &command, bool blocking)
#else #else
std::string cmd(command); std::string cmd(command);
if(split[2] == ".py" || split[2] == ".PY"){ if(split[2] == ".py" || split[2] == ".PY"){
if(split[0].empty()) cmd = "./" + cmd;
if(access(exe.c_str(), X_OK)){ if(access(exe.c_str(), X_OK)){
Msg::Info("Script '%s' is not executable: running with python", Msg::Info("Script '%s' is not executable: running with python", exe.c_str());
exe.c_str());
cmd = "python " + cmd; cmd = "python " + cmd;
} }
else if(split[0].empty()){
// workaround if pwd is not in PATH
cmd = "./" + cmd;
}
} }
if(!system(NULL)) { if(!system(NULL)) {
Msg::Error("Could not find /bin/sh: aborting system call"); Msg::Error("Could not find /bin/sh: aborting system call");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment