aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2023-09-09 20:43:07 +0200
committerGuldoman <giulio.lettieri@gmail.com>2023-09-09 20:43:07 +0200
commitd7e5a80c97e2a52de1baf63818040128bbb4c121 (patch)
treec0f7dbc89139c848121293084e1738070214cc73 /src/lpm.lua
parent2452630fd0f829074449c8bc0a12ba929e077e21 (diff)
downloadlite-xl-plugin-manager-d7e5a80c97e2a52de1baf63818040128bbb4c121.tar.gz
lite-xl-plugin-manager-d7e5a80c97e2a52de1baf63818040128bbb4c121.zip
Don't create user `init.lua` if no custom config was specified
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index e502860..c692b0c 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -1314,14 +1314,16 @@ function Bottle:construct()
common.rmrf(self.local_path)
if not self.lite_xl:is_installed() then self.lite_xl:install() end
common.mkdirp(self.local_path .. PATHSEP .. "user")
- io.open(self.local_path .. PATHSEP .. "user" .. PATHSEP .. "init.lua", "wb"):write([[
- local core = require "core"
- local command = require "core.command"
- local keymap = require "core.keymap"
- local config = require "core.config"
- local style = require "core.style"
- ]] .. self.config
- ):close()
+ if self.config then
+ io.open(self.local_path .. PATHSEP .. "user" .. PATHSEP .. "init.lua", "wb"):write([[
+ local core = require "core"
+ local command = require "core.command"
+ local keymap = require "core.keymap"
+ local config = require "core.config"
+ local style = require "core.style"
+ ]] .. self.config
+ ):close()
+ end
-- Always copy the executbale, because of the way that lite determines the user folder (for now).
common.copy(self.lite_xl:get_binary_path(), self.local_path .. PATHSEP .. "lite-xl" .. EXECUTABLE_EXTENSION)