awful: drop lfs in favor of mkdir -p

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-23 08:29:52 +02:00
parent d4273f4e96
commit fdddc839e8
1 changed files with 10 additions and 4 deletions

View File

@ -28,7 +28,6 @@ local capi =
hooks = hooks,
keygrabber = keygrabber
}
local lfs = require("lfs")
--- awful: AWesome Functions very UsefuL
module("awful")
@ -78,6 +77,13 @@ local function cycle(t, i)
return i
end
--- Create a directory
-- @param dir The directory.
-- @return mkdir return code
function mkdir(dir)
return os.execute("mkdir -p " .. dir)
end
--- Get the first client that got the urgent hint.
-- @return The first urgent client.
function client.urgent.get()
@ -870,11 +876,11 @@ local function prompt_history_save(id)
if prompt.history[id] then
local f = io.open(id, "w")
if not f then
local dir = ""
local i = 0
for d in id:gfind(".-/") do
dir = dir .. d
lfs.mkdir(dir)
i = i + #d
end
mkdir(id:sub(1, i - 1))
f = assert(io.open(id, "w"))
end
for i = 1, math.min(#prompt.history[id].table, prompt.history[id].max) do