Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions hooks/available.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,20 @@ function PLUGIN:Available(ctx)
break
end
local dartArch = info.dart_sdk_arch
local includeVersion = true
-- only flutter for macos supports different archs
if (type.osType == "macos") then
-- if dartArch is null, this means that the version does not support different archs
includeVersion = (dartArch == nil or dartArch == type.archType)
end
if (includeVersion) then
table.insert(result, {
version = info.version,
url = body.base_url .. "/" .. info.archive,
sha256 = info.sha256,
key = info.hash,
note = info.channel,
addition = {
{
name = "dart",
version = info.dart_sdk_version
}
version = dartArch and (version .. "-" .. dartArch) or version
table.insert(result, {
version = version,
url = body.base_url .. "/" .. info.archive,
sha256 = info.sha256,
key = info.hash,
note = info.channel,
addition = {
{
name = "dart",
version = info.dart_sdk_version
}
})
end
}
})
end
table.sort(result, function(a, b)
return compare_versions(a.version, b.version) > 0
Expand Down