Skip to content

Commit

Permalink
OpenOS: fix ls -l on Lua 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jun 4, 2023
1 parent 9c95f10 commit 34e1f1f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ local function formatTime(epochms) -- from /lib/core/full_ls.lua
if opts["full-time"] then
return string.format("%s-%s-%s %s:%s:%s ", d.year, pad(nod(d.month)), pad(day), hour, min, sec)
else
return string.format("%s %+2s %+2s:%+2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
return string.format("%s %2s %2s:%2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- called from /init.lua
local raw_loadfile = ...

_G._OSVERSION = "OpenOS 1.8.1"
_G._OSVERSION = "OpenOS 1.8.2"

-- luacheck: globals component computer unicode _OSVERSION
local component = component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ local function formatDate(epochms)
if ops["full-time"] then
return string.format("%s-%s-%s %s:%s:%s ", d.year, pad(nod(d.month)), pad(day), hour, min, sec)
else
return string.format("%s %+2s %+2s:%+2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
return string.format("%s %2s %2s:%2s ", month_names[d.month]:sub(1,3), day, hour, pad(min))
end
end

Expand Down Expand Up @@ -222,7 +222,7 @@ local function display(names)
local write_mode = info.fs.isReadOnly() and '-' or 'w'
local size = formatSize(info.size)
local modDate = formatDate(info.time)
local format = "%s-r%s %+"..tostring(max_size_width).."s %"..tostring(max_date_width).."s"
local format = "%s-r%s %"..tostring(max_size_width).."s %"..tostring(max_date_width).."s"
local meta = string.format(format, file_type, write_mode, size, modDate)
local item = info.name..link_target
return {{name = meta}, {color = colorize(info), name = item}}
Expand Down

0 comments on commit 34e1f1f

Please sign in to comment.