diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-03-03 15:37:32 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-03-03 15:37:32 -0500 |
commit | 3f022d841fb457fb8822b5ff6b76ffa7b3e26716 (patch) | |
tree | 1b95c3b199b58bb4f802c23fc3e60d76cf7dacd2 /src | |
parent | 256dccc7e6967128df17f41a3ab81be8208354b2 (diff) | |
download | lite-xl-plugin-manager-3f022d841fb457fb8822b5ff6b76ffa7b3e26716.tar.gz lite-xl-plugin-manager-3f022d841fb457fb8822b5ff6b76ffa7b3e26716.zip |
Allowed for disabling of self-upgrade.
Diffstat (limited to 'src')
-rw-r--r-- | src/lpm.c | 1 | ||||
-rw-r--r-- | src/lpm.lua | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -1336,6 +1336,7 @@ static const luaL_Reg system_lib[] = { #ifndef LPM_DEFAULT_REPOSITORY #define LPM_DEFAULT_REPOSITORY "https://github.com/lite-xl/lite-xl-plugin-manager.git:latest" #endif +// If this is defined as empty string, we disable self-upgrading. #ifndef LPM_DEFAULT_RELEASE #if _WIN32 #define LPM_DEFAULT_RELEASE "https://github.com/lite-xl/lite-xl-plugin-manager/releases/download/%r/lpm." LITE_ARCH_TUPLE ".exe" diff --git a/src/lpm.lua b/src/lpm.lua index 4cbb817..2ec9f67 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1986,6 +1986,7 @@ local function lpm_addon_upgrade() end local function lpm_self_upgrade(release) + if not DEFAULT_RELEASE_URL or #DEFAULT_RELEASE_URL == 0 then error("self-upgrade has been disabled on lpm version " .. VERSION .. "; please upgrade it however you installed it") end local path = ARGV[1]:find(PATHSEP) and system.stat(ARGV[1]) and ARGV[1] or common.path(ARGV[1]) if not path then error("can't find path to lpm") end release = release or "latest" |