Skip to content

Commit

Permalink
xpkg: add xvm
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunrisepeak committed Jan 6, 2025
1 parent 9f6b5db commit cb3bed5
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions pkgs/x/xvm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package = {
-- base info
name = "xvm",
description = "a simple and generic version management tool",

authors = "sunrisepeak",
maintainers = "d2learn",
contributors = "https://github.com/d2learn/xlings/graphs/contributors",
license = "Apache-2.0",
repo = "https://github.com/d2learn/xlings",

-- xim pkg info
archs = {"x86_64"},
status = "stable", -- dev, stable, deprecated
categories = {"tools", "version-management"},
keywords = {"rust", "cross-platform", "version-management"},

xpm = {
debain = {
["latest"] = { ref = "dev" },
["dev"] = {
url = "%.tar.gz$", -- url pattern
github_release_tag = "xvm-dev",
}
},
ubuntu = { ref = "debain" },
archlinux = { ref = "debain" },
},
}

import("platform")
import("xim.base.runtime")

local bindir = platform.get_config_info().bindir

local xvm_file = {
windows = "xvm.exe",
linux = "xvm",
}

function installed()
return os.iorun("xvm --version") ~= nil
end

function install()
os.cp(xvm_file[os.host()], bindir)
return true
end

function uninstall()
os.tryrm(path.join(bindir, xvm_file[os.host()]))
return true
end

0 comments on commit cb3bed5

Please sign in to comment.