Always use HOME based user's config independently from portable option

This commit is contained in:
Francesco Abbate 2020-12-04 12:01:49 +01:00
parent f88fd0f6cd
commit be189fda0d
1 changed files with 4 additions and 3 deletions

View File

@ -125,21 +125,22 @@ int main(int argc, char **argv) {
" EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n" " EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n"
#ifdef LITE_XL_DATA_USE_EXEDIR #ifdef LITE_XL_DATA_USE_EXEDIR
" DATADIR = EXEDIR .. '/data'\n" " DATADIR = EXEDIR .. '/data'\n"
" USERDIR = EXEDIR .. '/user'\n"
#else #else
" do\n" " do\n"
" local prefix = EXEDIR:match(\"^(.+)[/\\\\]bin$\")\n" " local prefix = EXEDIR:match(\"^(.+)[/\\\\]bin$\")\n"
" DATADIR = prefix and (prefix .. '/share/lite-xl') or (EXEDIR .. '/data')\n"
" end\n"
#endif
" do\n"
#ifdef _WIN32 #ifdef _WIN32
" local home = os.getenv('USERPROFILE')\n" " local home = os.getenv('USERPROFILE')\n"
#else #else
" local home = os.getenv('HOME')\n" " local home = os.getenv('HOME')\n"
#endif #endif
" DATADIR = prefix and (prefix .. '/share/lite-xl') or (EXEDIR .. '/data')\n"
" USERDIR = home and (home .. '/.config/lite-xl') or (EXEDIR .. '/user')\n" " USERDIR = home and (home .. '/.config/lite-xl') or (EXEDIR .. '/user')\n"
" end\n" " end\n"
" package.path = package.path .. ';' .. USERDIR .. '/?.lua'\n" " package.path = package.path .. ';' .. USERDIR .. '/?.lua'\n"
" package.path = package.path .. ';' .. USERDIR .. '/?/init.lua'\n" " package.path = package.path .. ';' .. USERDIR .. '/?/init.lua'\n"
#endif
" package.path = DATADIR .. '/?.lua;' .. package.path\n" " package.path = DATADIR .. '/?.lua;' .. package.path\n"
" package.path = DATADIR .. '/?/init.lua;' .. package.path\n" " package.path = DATADIR .. '/?/init.lua;' .. package.path\n"
" core = require('core')\n" " core = require('core')\n"