diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-07-27 22:03:10 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-07-27 22:03:10 -0400 |
commit | ebfb4a78b4bf879e56c0413f211737570567366e (patch) | |
tree | ecb9e1e4c6dfb1c6f87fe1310fbfc4f69e6f5aa5 | |
parent | 60273128b806896dfc87b9744e758a05e9e51f0a (diff) | |
download | lite-xl-plugin-manager-ebfb4a78b4bf879e56c0413f211737570567366e.tar.gz lite-xl-plugin-manager-ebfb4a78b4bf879e56c0413f211737570567366e.zip |
Normalized paths to backslashes.
-rw-r--r-- | src/lpm.lua | 2 |
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 |