Skip to content

Commit

Permalink
Remove hardcoded Clang versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yanecc committed Jun 29, 2024
1 parent 66cf78d commit 3289cf7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 47 deletions.
69 changes: 23 additions & 46 deletions lib/util.lua
Original file line number Diff line number Diff line change
@@ -1,49 +1,26 @@
local ClangVersions = {
"18.1.8",
"18.1.7",
"18.1.6",
"18.1.5",
"18.1.4",
"18.1.3",
"18.1.2",
"18.1.1",
"17.0.6",
"17.0.5",
"17.0.4",
"17.0.3",
"17.0.2",
"17.0.1",
"16.0.6",
"16.0.5",
"16.0.4",
"16.0.3",
"16.0.2",
"16.0.1",
"16.0.0",
"15.0.7",
"15.0.6",
"15.0.5",
"15.0.4",
"15.0.3",
"15.0.2",
"15.0.1",
"15.0.0",
"14.0.6",
"14.0.5",
"14.0.4",
"14.0.3",
"14.0.0",
"13.0.1",
"13.0.0",
"12.0.1",
"12.0.0",
"11.1.0",
"11.0.1",
"11.0.0",
"10.0.1",
"10.0.0",
"9.0.1",
}
local http = require("http")
local json = require("json")

function fetchVersions()
local versionList
local githubURL = os.getenv("GITHUB_URL") or "https://github.com/"
local resp, err = http.get({
url = githubURL:gsub("/$", "") .. "/version-fox/vfox-clang/releases/manifest",
})
if err ~= nil then
error("Failed to request: " .. err)
end
if resp.status_code ~= 200 then
error("Failed to get versions: " .. err .. "\nstatus_code => " .. resp.status_code)
end

versionList = resp.body:match("<code>(.-)</code>")
versionList = json.decode(versionList)["conda-forge"]

return versionList
end

local ClangVersions = fetchVersions()

function fetchAvailable(noCache)
local result = {}
Expand Down
2 changes: 1 addition & 1 deletion metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PLUGIN = {}
--- Plugin name
PLUGIN.name = "clang"
--- Plugin version
PLUGIN.version = "0.1.1"
PLUGIN.version = "0.1.2"
--- Plugin homepage
PLUGIN.homepage = "https://github.com/version-fox/vfox-clang"
--- Plugin license, please choose a correct license according to your needs.
Expand Down

0 comments on commit 3289cf7

Please sign in to comment.