• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nightconcept / almandine / 14719482440

28 Apr 2025 10:55PM UTC coverage: 90.086% (-7.1%) from 97.146%
14719482440

push

github

nightconcept
wip

3 of 3 new or added lines in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

1154 of 1281 relevant lines covered (90.09%)

1.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.67
/src/modules/list.lua
1
--[[
2
  List Command Module
3

4
  Provides functionality to list all installed dependencies and their versions as recorded in the lockfile
5
  (almd-lock.lua) or manifest (project.lua).
6
]]
7
--
8

9
--- Lists installed dependencies and their versions.
10
-- @param load_manifest function Function to load the manifest.
11
-- @param load_lockfile function Function to load the lockfile.
12
local function list_dependencies(load_manifest, load_lockfile)
13
  local lockfile = nil
7✔
14
  local lockfile_exists = false
7✔
15
  if type(load_lockfile) == "function" then
7✔
16
    lockfile = load_lockfile()
6✔
17
    lockfile_exists = lockfile ~= nil
6✔
18
  end
19
  local dependencies = {}
7✔
20
  if lockfile_exists and type(lockfile) == "table" and lockfile.dependencies then
7✔
21
    dependencies = lockfile.dependencies
3✔
22
  else
23
    local manifest = load_manifest()
4✔
24
    if type(manifest) == "table" and manifest.dependencies then
4✔
25
      dependencies = manifest.dependencies
1✔
26
    end
27
  end
28
  if next(dependencies) == nil then
7✔
29
    print("No dependencies found.")
3✔
30
    return
3✔
31
  end
32
  print("Installed dependencies:")
4✔
33
  for name, dep in pairs(dependencies) do
10✔
34
    local version
35
    if type(dep) == "table" then
6✔
36
      version = dep.version or (dep.hash and "#" .. dep.hash)
4✔
37
      if not version or version == "" then
4✔
38
        version = "(unknown)"
1✔
39
      end
40
    elseif type(dep) == "string" then
2✔
41
      version = dep
2✔
42
    else
UNCOV
43
      version = "(unknown)"
×
44
    end
45
    print(string.format("  %s\t%s", name, version))
6✔
46
  end
47
end
48

49
---
50
-- Prints usage/help information for the `list` command.
51
-- Usage: almd list
52
-- Lists all installed dependencies and their versions.
53
local function help_info()
54
  print([[\nUsage: almd list
2✔
55

56
Lists all installed dependencies and their versions as recorded in the lockfile or project.lua.
57
Example:
58
  almd list]])
1✔
59
end
60

61
return {
1✔
62
  list_dependencies = list_dependencies,
1✔
63
  help_info = help_info,
1✔
64
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc