Merge pull request #763 from Jipok/portable_try
Support portable user config(Fix #762)
This commit is contained in:
commit
1e6046e499
|
@ -12,8 +12,9 @@ else
|
|||
local prefix = EXEDIR:match("^(.+)[/\\]bin$")
|
||||
DATADIR = prefix and (prefix .. '/share/lite-xl') or (EXEDIR .. '/data')
|
||||
end
|
||||
USERDIR = (os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME") .. "/lite-xl")
|
||||
or (HOME and (HOME .. '/.config/lite-xl') or (EXEDIR .. '/user'))
|
||||
USERDIR = (system.get_file_info(EXEDIR .. '/user') and (EXEDIR .. '/user'))
|
||||
or ((os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME") .. "/lite-xl"))
|
||||
or (HOME and (HOME .. '/.config/lite-xl'))
|
||||
|
||||
package.path = DATADIR .. '/?.lua;' .. package.path
|
||||
package.path = DATADIR .. '/?/init.lua;' .. package.path
|
||||
|
|
Loading…
Reference in New Issue