Get the shell for spawn_with_shell earlier
My local config got a module which denies functions from adding new functions to the global context or to a module's local context. I use this for catching typos (think misspelled variable names). This patch "fixes" a false-positive which was caused by this. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
56d6e3726b
commit
f931e0cb8e
|
@ -26,6 +26,8 @@ module("awful.util")
|
||||||
|
|
||||||
table = {}
|
table = {}
|
||||||
|
|
||||||
|
shell = os.getenv("SHELL") or "/bin/sh"
|
||||||
|
|
||||||
function deprecate(see)
|
function deprecate(see)
|
||||||
io.stderr:write("W: awful: function is deprecated")
|
io.stderr:write("W: awful: function is deprecated")
|
||||||
if see then
|
if see then
|
||||||
|
@ -79,10 +81,6 @@ end
|
||||||
-- @param screen The screen where to run the command.
|
-- @param screen The screen where to run the command.
|
||||||
function spawn_with_shell(cmd, screen)
|
function spawn_with_shell(cmd, screen)
|
||||||
if cmd and cmd ~= "" then
|
if cmd and cmd ~= "" then
|
||||||
-- Get the shell once for all
|
|
||||||
if not shell then
|
|
||||||
shell = os.getenv("SHELL") or "/bin/sh"
|
|
||||||
end
|
|
||||||
cmd = shell .. " -c \"" .. cmd .. "\""
|
cmd = shell .. " -c \"" .. cmd .. "\""
|
||||||
return capi.awesome.spawn(cmd, false, screen or capi.mouse.screen)
|
return capi.awesome.spawn(cmd, false, screen or capi.mouse.screen)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue