First implementation of unix-like data directory

It basically works by setting the data directory to

$prefix/share/lite-xl

where $prefix is determined so that $prefix/bin corresponds to EXEDIR.

The packages 'user' and 'user.*' are loaded from the directory
'$HOME/.config/lite-xl'.
This commit is contained in:
Francesco Abbate
2020-12-02 00:23:15 +01:00
parent e9938862b5
commit 3589d7d3c0
6 changed files with 49 additions and 10 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ function core.init()
CommandView = require "core.commandview"
Doc = require "core.doc"
local project_dir = EXEDIR
local project_dir = "."
local files = {}
for i = 2, #ARGS do
local info = system.get_file_info(ARGS[i]) or {}
@@ -187,7 +187,7 @@ end
function core.load_plugins()
local no_errors = true
local files = system.list_dir(EXEDIR .. "/data/plugins")
local files = system.list_dir(DATADIR .. "/plugins")
for _, filename in ipairs(files) do
local modname = "plugins." .. filename:gsub(".lua$", "")
local ok = core.try(require, modname)