Skip to content

Commit

Permalink
fix: manifest url
Browse files Browse the repository at this point in the history
  • Loading branch information
aooohan committed Mar 25, 2024
1 parent 062607a commit 069e6fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions internal/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ type LuaPluginInfo struct {
Version string `luai:"version"`
Description string `luai:"description"`
UpdateUrl string `luai:"updateUrl"` // TODO Will be deprecated in future versions
ManifestUrl string `luai:"manifestUrl"`
Homepage string `luai:"homepage"`
License string `luai:"license"`
MinRuntimeVersion string `luai:"minRuntimeVersion"`
Expand Down
4 changes: 2 additions & 2 deletions internal/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func TestNewLuaPluginWithMetadataAndHooks(t *testing.T) {
t.Errorf("expected description 'xxx', got '%s'", plugin.Description)
}

if plugin.UpdateUrl != "{URL}/sdk.lua" {
t.Errorf("expected update url '{URL}/sdk.lua', got '%s'", plugin.UpdateUrl)
if plugin.ManifestUrl != "manifest.json" {
t.Errorf("expected manifest url 'manifest.json', got '%s'", plugin.ManifestUrl)
}

if plugin.MinRuntimeVersion != "0.2.2" {
Expand Down
2 changes: 1 addition & 1 deletion internal/printer/select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestSelect_Show(t *testing.T) {
}
s := &PageKVSelect{
index: 0,
SourceFunc: func(page, size int) ([]*KV, error) {
SourceFunc: func(page, size int, options []*KV) ([]*KV, error) {
// 计算开始和结束索引
start := page * size
end := start + size
Expand Down
15 changes: 3 additions & 12 deletions internal/testdata/plugins/java_with_metadata/metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,17 @@ PLUGIN = {}
PLUGIN.name = "java"
--- Plugin version
PLUGIN.version = "0.0.1"
-- Update URL, will deprecated in the future
---@deprecated
PLUGIN.updateUrl = "{URL}/sdk.lua"
-- Repository URL
PLUGIN.repository = "https://github.com/version-fox/vfox-plugin-template"

PLUGIN.notes = {
"some notes",
"some notes",
}

-- Some preset configurations
PLUGIN.presets = {
"nodejs",
"tinghua",
"npmmirror"
"",
}

--- !!! OPTIONAL !!!
--- Plugin description
PLUGIN.description = "xxx"
-- minimum compatible vfox version
PLUGIN.minRuntimeVersion = "0.2.2"

PLUGIN.manifestUrl = "manifest.json"

0 comments on commit 069e6fe

Please sign in to comment.