2020-12-28 16:18:03 +01:00
|
|
|
local core = require "core"
|
|
|
|
local command = require "core.command"
|
2021-06-13 19:50:42 +02:00
|
|
|
local common = require "core.common"
|
2021-06-07 22:44:35 +02:00
|
|
|
|
2020-12-28 16:18:03 +01:00
|
|
|
command.add(nil, {
|
|
|
|
["files:create-directory"] = function()
|
|
|
|
core.command_view:enter("New directory name", function(text)
|
2021-06-13 19:50:42 +02:00
|
|
|
local success, err, path = common.mkdirp(text)
|
2020-12-28 16:18:03 +01:00
|
|
|
if not success then
|
2021-06-07 22:44:35 +02:00
|
|
|
core.error("cannot create directory %q: %s", path, err)
|
2020-12-28 16:18:03 +01:00
|
|
|
end
|
|
|
|
end)
|
|
|
|
end,
|
|
|
|
})
|