aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-07-09 17:01:43 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-07-09 17:01:43 -0400
commitc8390569f6eceedd71b7090ef52a4f88886bc475 (patch)
tree88a1a1159c3cbdf36eca2e58c8ed28fb85888fe7 /src/lpm.lua
parentc554678b9a08da51dec43a645bc420cc7fad445a (diff)
downloadlite-xl-plugin-manager-c8390569f6eceedd71b7090ef52a4f88886bc475.tar.gz
lite-xl-plugin-manager-c8390569f6eceedd71b7090ef52a4f88886bc475.zip
Updated LPM_DEFAULT_REPOSITORY to be a define, as well as fixed issue with downloading from domains without paths.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index 5239797..2c66de1 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -552,6 +552,7 @@ function common.get(source, target, checksum, callback, depth)
log_progress_action("Downloading " .. source:sub(1, 100) .. "...")
if not protocol then error("malfomed url " .. source) end
if not port or port == "" then port = protocol == "https" and 443 or 80 end
+ if not rest or rest == "" then rest = "/" end
if not checksum then
local res, headers = system.get(protocol, hostname, port, rest, target, callback)
if headers.location then return common.get(headers.location, target, checksum, callback, (depth or 0) + 1) end
@@ -1466,7 +1467,7 @@ end
local DEFAULT_REPOS
local function lpm_repo_init(repos)
- DEFAULT_REPOS = { Repository.url("https://github.com/adamharrison/lite-xl-plugin-manager.git:latest") }
+ DEFAULT_REPOS = { Repository.url(DEFAULT_REPO_URL) }
common.mkdirp(CACHEDIR)
if not system.stat(CACHEDIR .. PATHSEP .. "settings.json") then
for i, repository in ipairs(repos or DEFAULT_REPOS) do
@@ -1906,9 +1907,9 @@ It's designed to install packages from our central github repository (and
affiliated repositories), directly into your lite-xl user directory. It can
be called independently, or from the lite-xl `plugin_manager` addon.
-LPM will always use https://github.com/lite-xl/lite-xl-plugin-manager as its base
-repository, if none are present, and the cache directory does't exist,
-but others can be added, and this base one can be removed.
+LPM will always use ]] .. DEFAULT_REPO_URL .. [[
+as its base repository, if none are present, and the cache directory
+does't exist, but others can be added, and this base one can be removed.
It has the following commands: