Fix bug related to creation of user's init file

This commit is contained in:
Francesco Abbate 2020-12-07 17:38:36 +01:00
parent ca9bf21819
commit ebaa2b4f26
1 changed files with 5 additions and 2 deletions

View File

@ -137,9 +137,12 @@ end
local function load_user_directory()
local init_filename = USERDIR .. "/init.lua"
local info = system.get_file_info(USERDIR)
if not info then
local stat_info_dir = system.get_file_info(USERDIR)
if not stat_info_dir then
create_user_directory()
end
local stat_info_file = system.get_file_info(init_filename)
if not stat_info_file then
write_user_init_file(init_filename)
end
return dofile(init_filename)