Skip to content

Commit

Permalink
PR #644: Test version colorization with hook and Personal/SitePackage…
Browse files Browse the repository at this point in the history
….lua
  • Loading branch information
Robert McLay committed Jun 12, 2023
1 parent bd08301 commit dc9385b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion contrib/Personal/SitePackage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ local function l_colorize_fullName(fullName, sn)
local version = extractVersion(fullName, sn)
local version_color = getenv("LMOD_DISPLAY_VERSION_COLOR")
local sn_color = getenv("LMOD_DISPLAY_SN_COLOR")
local meta_color = getenv("LMOD_DISPLAY_META_COLOR")

---- colorize() will use `plain` if `color` is not found.

local moduleName = colorize(sn_color, sn)
if (version) then
moduleName = moduleName .. colorize(version_color, "/"..version)
else
moduleName = colorize(meta_color, sn)
end
return moduleName
end
Expand Down
4 changes: 3 additions & 1 deletion contrib/TACC/SitePackage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ local function l_colorize_fullName(fullName, sn)
local version = extractVersion(fullName, sn)
local version_color = getenv("LMOD_DISPLAY_VERSION_COLOR")
local sn_color = getenv("LMOD_DISPLAY_SN_COLOR")
local meta_color = getenv("LMOD_DISPLAY_META_COLOR")

---- colorize() will use `plain` if `color` is not found.

local moduleName = colorize(sn_color, sn)
if (version) then
moduleName = moduleName .. colorize(version_color, "/"..version)
else
moduleName = colorize(meta_color, sn)
end
return moduleName
end
Expand Down

0 comments on commit dc9385b

Please sign in to comment.