feat: use USERPROFILE to retrieve readable path on Windows (#331)

This commit is contained in:
Simone Fidanza 2023-11-02 12:22:05 +01:00 committed by GitHub
parent 2d6a95ff5a
commit 73941c2291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ function utils.readable_size(size)
end
function utils.readable_path(path)
local home = os.getenv("HOME")
local home = os.getenv("HOME") or os.getenv("USERPROFILE")
if home == nil then
return path
elseif string.sub(path, 1, #home) == home then