aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-07-27 22:03:10 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-07-27 22:03:10 -0400
commitebfb4a78b4bf879e56c0413f211737570567366e (patch)
treeecb9e1e4c6dfb1c6f87fe1310fbfc4f69e6f5aa5 /src
parent60273128b806896dfc87b9744e758a05e9e51f0a (diff)
downloadlite-xl-plugin-manager-ebfb4a78b4bf879e56c0413f211737570567366e.tar.gz
lite-xl-plugin-manager-ebfb4a78b4bf879e56c0413f211737570567366e.zip
Normalized paths to backslashes.
Diffstat (limited to 'src')
-rw-r--r--src/lpm.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index 6434a74..6fd5649 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -388,7 +388,7 @@ end
function common.dirname(path) local s = path:reverse():find("[/\\]") if not s then return path end return path:sub(1, #path - s) end
function common.basename(path) local s = path:reverse():find("[/\\]") if not s then return path end return path:sub(#path - s + 2) end
function common.path(exec) return common.first(common.map({ common.split(":", os.getenv("PATH")) }, function(e) return e .. PATHSEP .. exec end), function(e) local s = system.stat(e) return s and s.type ~= "dir" and s.mode & 73 end) end
-function common.normalize_path(path) if not path or not path:find("^~") then return path end return os.getenv("HOME") .. path:sub(2) end
+function common.normalize_path(path) if PLATFORM == "Windows" and path then path = path:gsub("/", PATHSEP) end if not path or not path:find("^~") then return path end return os.getenv("HOME") .. path:sub(2) end
function common.rmrf(root)
local info = root and root ~= "" and system.stat(root)
if not info then return end