aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lpm.c2
-rw-r--r--src/lpm.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/lpm.c b/src/lpm.c
index 227533b..313e4ac 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -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