diff options
author | Adam <adamdharrison@gmail.com> | 2023-09-10 10:01:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-10 10:01:10 -0400 |
commit | 4c8ed7b12d9e82a844ec802f16587206748ad60c (patch) | |
tree | cb97fdbf534b7de79f96a2ec8e990f2138723bb1 | |
parent | e83d6765815ee811b9a8b03483b58723204e845d (diff) | |
parent | d7e5a80c97e2a52de1baf63818040128bbb4c121 (diff) | |
download | lite-xl-plugin-manager-4c8ed7b12d9e82a844ec802f16587206748ad60c.tar.gz lite-xl-plugin-manager-4c8ed7b12d9e82a844ec802f16587206748ad60c.zip |
Merge pull request #42 from Guldoman/PR_fix_bottle_creation_without_config
Don't create user `init.lua` if no custom config was specified
-rw-r--r-- | src/lpm.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 7ce26d3..55ff025 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) |