Fix error when using relative dir argument
This commit is contained in:
parent
2a9fd899b5
commit
03818d13fd
|
@ -37,8 +37,8 @@ local function normalize_path(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function add_project_to_recents(dirname)
|
local function add_project_to_recents(dir_path_abs)
|
||||||
dirname = normalize_path(system.absolute_path(dirname))
|
local dirname = normalize_path(dir_path_abs)
|
||||||
if not dirname then return end
|
if not dirname then return end
|
||||||
local recents = core.recent_projects
|
local recents = core.recent_projects
|
||||||
local n = #recents
|
local n = #recents
|
||||||
|
@ -74,11 +74,11 @@ function core.set_project_dir(new_dir, change_project_fn)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function core.open_folder_project(dirname)
|
function core.open_folder_project(dir_path_abs)
|
||||||
if core.set_project_dir(dirname, core.on_quit_project) then
|
if core.set_project_dir(dirname, core.on_quit_project) then
|
||||||
core.root_view:close_all_docviews()
|
core.root_view:close_all_docviews()
|
||||||
add_project_to_recents(dirname)
|
add_project_to_recents(dir_path_abs)
|
||||||
core.on_enter_project(dirname)
|
core.on_enter_project(dir_path_abs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ function core.init()
|
||||||
local project_dir_abs = system.absolute_path(project_dir)
|
local project_dir_abs = system.absolute_path(project_dir)
|
||||||
local set_project_ok = core.set_project_dir(project_dir_abs)
|
local set_project_ok = core.set_project_dir(project_dir_abs)
|
||||||
if set_project_ok then
|
if set_project_ok then
|
||||||
add_project_to_recents(project_dir)
|
add_project_to_recents(project_dir_abs)
|
||||||
else
|
else
|
||||||
core.error("Cannot enter project directory %q", project_dir)
|
core.error("Cannot enter project directory %q", project_dir)
|
||||||
project_dir_abs = system.absolute_path(".")
|
project_dir_abs = system.absolute_path(".")
|
||||||
|
|
Loading…
Reference in New Issue