feat: add function to retrieve system architecture

This commit is contained in:
2024-11-23 14:22:35 -05:00
parent 6cf46f13eb
commit 1fc5368cb7
+18
View File
@@ -2434,5 +2434,23 @@ function M.help_lookup_quoted_visual()
M.help_lookup_string(M.wrap_in_quotes(selected_text))
end
function M.get_system_arch()
-- Use jit.arch if available
if jit and jit.arch then
return jit.arch
end
-- Fallback to `uname -m`
local handle = io.popen('uname -m')
if handle then
local result = handle:read('*a'):gsub('%s+', '')
handle:close()
return result
end
-- If all else fails
return 'unknown'
end
-- Export the module
return M