fix(process_util): Prefix shell env var

Fixes #566
This commit is contained in:
Michael Carlberg 2017-05-12 17:40:06 +02:00
parent b6c5563b0b
commit 86ff947e38

View File

@ -37,11 +37,10 @@ namespace process_util {
* Execute command using shell
*/
void exec_sh(const char* cmd) {
static const string shell{env_util::get("SHELL", "/bin/sh")};
if (cmd != nullptr) {
static const string shell{env_util::get("POLYBAR_SHELL", "/bin/sh")};
execlp(shell.c_str(), shell.c_str(), "-c", cmd, nullptr);
throw system_error("execvp() failed");
throw system_error("execlp() failed");
}
}