Skip to content

Commit

Permalink
Auto make directory of g:rogue#directory if not exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
katono committed Nov 19, 2021
1 parent 830767e commit d9af835
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autoload/rogue/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ local function init_dirs()
else
g.game_dir = g.game_dir:gsub('\\', '/')
g.game_dir = g.game_dir:gsub('~', g.home_dir)
if vim then
local exists = vim.eval('isdirectory("' .. g.game_dir .. '")')
if exists == 0 then
vim.command('call mkdir("' .. g.game_dir .. '", "p")')
end
end
end

if string.char(g.home_dir:byte(#g.home_dir)) ~= '/' then
Expand Down

0 comments on commit d9af835

Please sign in to comment.