mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
awful: drop lfs in favor of mkdir -p
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
d4273f4e96
commit
fdddc839e8
1 changed files with 10 additions and 4 deletions
|
@ -28,7 +28,6 @@ local capi =
|
||||||
hooks = hooks,
|
hooks = hooks,
|
||||||
keygrabber = keygrabber
|
keygrabber = keygrabber
|
||||||
}
|
}
|
||||||
local lfs = require("lfs")
|
|
||||||
|
|
||||||
--- awful: AWesome Functions very UsefuL
|
--- awful: AWesome Functions very UsefuL
|
||||||
module("awful")
|
module("awful")
|
||||||
|
@ -78,6 +77,13 @@ local function cycle(t, i)
|
||||||
return i
|
return i
|
||||||
end
|
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.
|
--- Get the first client that got the urgent hint.
|
||||||
-- @return The first urgent client.
|
-- @return The first urgent client.
|
||||||
function client.urgent.get()
|
function client.urgent.get()
|
||||||
|
@ -870,11 +876,11 @@ local function prompt_history_save(id)
|
||||||
if prompt.history[id] then
|
if prompt.history[id] then
|
||||||
local f = io.open(id, "w")
|
local f = io.open(id, "w")
|
||||||
if not f then
|
if not f then
|
||||||
local dir = ""
|
local i = 0
|
||||||
for d in id:gfind(".-/") do
|
for d in id:gfind(".-/") do
|
||||||
dir = dir .. d
|
i = i + #d
|
||||||
lfs.mkdir(dir)
|
|
||||||
end
|
end
|
||||||
|
mkdir(id:sub(1, i - 1))
|
||||||
f = assert(io.open(id, "w"))
|
f = assert(io.open(id, "w"))
|
||||||
end
|
end
|
||||||
for i = 1, math.min(#prompt.history[id].table, prompt.history[id].max) do
|
for i = 1, math.min(#prompt.history[id].table, prompt.history[id].max) do
|
||||||
|
|
Loading…
Reference in a new issue