diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-11-08 09:36:00 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-11-08 09:36:00 -0500 |
commit | 275a0fe5bd0907c11973d891402dc09b7ae68f62 (patch) | |
tree | bbbbebc2406c14685d254fee8e84e667fa0c9200 | |
parent | e23c9fd56e8624ba6f24033b1a8d2aaa6074416f (diff) | |
download | lite-xl-plugin-manager-275a0fe5bd0907c11973d891402dc09b7ae68f62.tar.gz lite-xl-plugin-manager-275a0fe5bd0907c11973d891402dc09b7ae68f62.zip |
Disabled switch if no default release url.
-rw-r--r-- | src/lpm.c | 2 | ||||
-rw-r--r-- | src/lpm.lua | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -1758,7 +1758,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. +// If this is defined as empty string, we disable self-upgrading, as well as switching the executable symlink. #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 450c8d2..111fcc3 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1828,6 +1828,7 @@ end function lpm.lite_xl_switch(version, target) + if not DEFAULT_RELEASE_URL or #DEFAULT_RELEASE_URL == 0 then error("switch has been disabled on lpm version " .. VERSION .. "; please switch it however you installed it") end if not version then error("requires a version") end target = target or common.path("lite-xl" .. EXECUTABLE_EXTENSION) if not target then error("can't find installed lite-xl. please provide a target to install the symlink explicitly as a second argument") end |