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

better

parent 07efddbd
Branches
Tags
No related merge requests found
......@@ -254,12 +254,14 @@ int SystemCall(const std::string &command, bool blocking)
#else
std::string cmd(command);
if(split[2] == ".py" || split[2] == ".PY"){
if(split[0].empty()) cmd = "./" + cmd;
if(access(exe.c_str(), X_OK)){
Msg::Info("Script '%s' is not executable: running with python",
exe.c_str());
Msg::Info("Script '%s' is not executable: running with python", exe.c_str());
cmd = "python " + cmd;
}
else if(split[0].empty()){
// workaround if pwd is not in PATH
cmd = "./" + cmd;
}
}
if(!system(NULL)) {
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