Added in ability to specify prefix via env variable. (#1388)
This commit is contained in:
parent
9b45c9bdbd
commit
9284e92291
|
@ -12,7 +12,7 @@ EXEDIR = EXEFILE:match("^(.+)[/\\][^/\\]+$")
|
|||
if MACOS_RESOURCES then
|
||||
DATADIR = MACOS_RESOURCES
|
||||
else
|
||||
local prefix = EXEDIR:match("^(.+)[/\\]bin$")
|
||||
local prefix = os.getenv('LITE_PREFIX') or EXEDIR:match("^(.+)[/\\]bin$")
|
||||
DATADIR = prefix and (prefix .. PATHSEP .. 'share' .. PATHSEP .. 'lite-xl') or (EXEDIR .. PATHSEP .. 'data')
|
||||
end
|
||||
USERDIR = (system.get_file_info(EXEDIR .. PATHSEP .. 'user') and (EXEDIR .. PATHSEP .. 'user'))
|
||||
|
|
|
@ -250,10 +250,7 @@ init_lua:
|
|||
"xpcall(function()\n"
|
||||
" HOME = os.getenv('" LITE_OS_HOME "')\n"
|
||||
" local exedir = EXEFILE:match('^(.*)" LITE_PATHSEP_PATTERN LITE_NONPATHSEP_PATTERN "$')\n"
|
||||
" local prefix = exedir:match('^(.*)" LITE_PATHSEP_PATTERN "bin$')\n"
|
||||
" if not HOME then\n"
|
||||
" HOME = exedir\n"
|
||||
" end\n"
|
||||
" local prefix = os.getenv('LITE_PREFIX') or exedir:match('^(.*)" LITE_PATHSEP_PATTERN "bin$')\n"
|
||||
" dofile((MACOS_RESOURCES or (prefix and prefix .. '/share/lite-xl' or exedir .. '/data')) .. '/core/start.lua')\n"
|
||||
" core = require(os.getenv('LITE_XL_RUNTIME') or 'core')\n"
|
||||
" core.init()\n"
|
||||
|
|
Loading…
Reference in New Issue