do not use 'portable' as a compile time option

Introduce the file core/start.lua to initialize applications variables
This commit is contained in:
Francesco Abbate
2021-02-24 16:29:39 +01:00
parent ea8a8770ea
commit 351a772466
5 changed files with 22 additions and 27 deletions
-2
View File
@@ -1,5 +1,3 @@
global {VERSION = "1.16.0"}
local config = {}
config.project_scan_rate = 5
+17
View File
@@ -0,0 +1,17 @@
-- this file is used by lite-xl to setup the Lua environment
-- when starting
VERSION = "1.16.0"
SCALE = tonumber(os.getenv("LITE_SCALE")) or SCALE
PATHSEP = package.config:sub(1, 1)
EXEDIR = EXEFILE:match("^(.+)[/\\][^/\\]+$")
local prefix = EXEDIR:match("^(.+)[/\\]bin$")
DATADIR = prefix and (prefix .. '/share/lite-xl') or (EXEDIR .. '/data')
USERDIR = HOME and (HOME .. '/.config/lite-xl') or (EXEDIR .. '/user')
package.path = package.path .. ';' .. USERDIR .. '/?.lua'
package.path = package.path .. ';' .. USERDIR .. '/?/init.lua'
package.path = DATADIR .. '/?.lua;' .. package.path
package.path = DATADIR .. '/?/init.lua;' .. package.path