Skip to content

Commit

Permalink
update utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunrisepeak committed Jan 10, 2025
1 parent c89a453 commit 1e05aa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/xim/base/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function local_package_manager()
pm = "winget"
elseif osinfo.name == "ubuntu" then
pm = "apt"
elseif osinfo.name == "archlinux" then
elseif osinfo.name == "archlinux" or osinfo.name == "manjaro" then
pm = "pacman"
elseif is_host("macosx") then
-- TODO
Expand Down
11 changes: 9 additions & 2 deletions core/xim/pm/wrapper/aur.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ function install(name)
-- 克隆 AUR 仓库
if not os.isdir(name) then
local git_url = to_git_url(name)
cprint("cloning %s...", git_url)
os.run("git clone %s", git_url)
os.cd(name)
else
cpint("%s already exists, try to update...", name)
cprint("${bright}%s${clear} already exists, try to update...", name)
os.cd(name)
os.run("git pull")
end

-- 构建并安装包
os.run("makepkg -si")
cprint("building %s...", name)
os.exec("makepkg -si")

return true
end
Expand All @@ -42,6 +44,11 @@ function uninstall(name)
end

function info(name)

if installed(name) then
return pacman.info(name)
end

local info = aur_info(name)
return format([[
${bright}[ XVM-AUR Package Info ]${clear}
Expand Down

0 comments on commit 1e05aa0

Please sign in to comment.