fix: apply suggested changes

This commit is contained in:
Simone Fidanza 2023-11-02 09:24:30 +01:00 committed by GitHub
parent 7c72860d34
commit 885f9e823b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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