Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
jq '.plugins[] | select(.name == nvim-telescope/telescope-fzf-native.nvim)' plugins.json > ~/luarocks-tag-release/test.json
  • Loading branch information
teto committed Jul 10, 2024
1 parent 3553ef8 commit ea7d8e8
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 39 deletions.
31 changes: 15 additions & 16 deletions bin/rockspec-generator-cli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ package_name = arg[0]
dependencies = arg[1]
rockspect_template = arg[1]

local rockspec = require('ltr.rockspec').generate(package_name, modrev, specrev, rockspec_template, {
ref_type = args.ref_type,
git_server_url = args.git_server_url,
github_repo = args.github_repo,
license = args.license,
git_ref = args.git_ref,
summary = args.summary,
detailed_description_lines = args.detailed_description_lines,
dependencies = args.dependencies,
test_dependencies = args.test_dependencies,
labels = args.labels,
copy_directories = args.copy_directories,
repo_name = args.repo_name,
github_event_tbl = github_event_tbl,
})

local rockspec = require('ltr.rockspec').generate(package_name, modrev, specrev, rockspec_template, {
ref_type = args.ref_type,
git_server_url = args.git_server_url,
github_repo = args.github_repo,
license = args.license,
git_ref = args.git_ref,
summary = args.summary,
detailed_description_lines = args.detailed_description_lines,
dependencies = args.dependencies,
test_dependencies = args.test_dependencies,
labels = args.labels,
copy_directories = args.copy_directories,
repo_name = args.repo_name,
github_event_tbl = github_event_tbl,
})
84 changes: 61 additions & 23 deletions bin/rockspec-generator-json.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,69 @@
#!/usr/bin/env lua
local json = require('dkjson')

json.decode(github_event_data)
local input = io.stdin:read('*all')
-- print('You entered: ' .. input)

local input = io.stdin:read("*all")
print("You entered: " .. input)
meta = json.decode(input)

package_name = input.name
dependencies = input.dependencies
license = input.license
-- split after the
package_name = meta.shorthand
dependencies = meta.dependencies
license = meta.license
summary = meta.summary
-- server_url =
meta.repo_name = package_name
meta.github_repo = meta.name
meta.git_ref = 'main' -- TODO adjust
meta.detailed_description_lines = ''
meta.copy_directories = meta.extra_directories
meta.labels = { 'neovim' }
meta.test_dependencies = {}

local rockspec = require('ltr.rockspec').generate(
package_name, modrev, specrev, rockspec_template,
{
ref_type = args.ref_type,
git_server_url = args.git_server_url,
github_repo = args.github_repo,
license = args.license,
git_ref = args.git_ref,
summary = args.summary,
detailed_description_lines = args.detailed_description_lines,
dependencies = args.dependencies,
test_dependencies = args.test_dependencies,
labels = args.labels,
copy_directories = args.copy_directories,
repo_name = args.repo_name,
github_event_tbl = github_event_tbl,
})
-- TODO split
-- meta.dependencies = meta.dependencies
meta.git_server_url = 'https://github.com'
-- meta["github_repo"] = "lol"
-- print(meta.github_repo)

local result = {}
-- if dependencies is empty then we
-- for line in string.gmatch(meta.dependencies .. "\n", "(.-)\n") do
-- table.insert(result, line);
-- end

meta.dependencies = result
-- print(meta.dependencies)

local rockspec_template_file_path = './resources/rockspec.template'
-- rockspec_template_file_path
local rockspec_template_fd =
assert(io.open(rockspec_template_file_path, 'r'), 'Could not open ' .. rockspec_template_file_path)
local rockspec_template = rockspec_template_fd:read('*a')

local specrev = 1
local modrev = 1
local rockspec = require('ltr.rockspec').generate(
package_name,
modrev,
specrev,
rockspec_template,
meta
-- {
-- -- ref_type = args.ref_type,
-- -- git_server_url = args.git_server_url,
-- -- github_repo = args.github_repo,
-- license = license,
-- -- git_ref = args.git_ref,
-- summary = summary,
-- -- detailed_description_lines = args.detailed_description_lines,
-- -- dependencies = args.dependencies,
-- -- test_dependencies = args.test_dependencies,
-- -- labels = args.labels,
-- -- copy_directories = args.copy_directories,
-- -- repo_name = args.repo_name,
-- github_event_tbl = meta,
-- }
)

print(rockspec)
1 change: 1 addition & 0 deletions luarocks-tag-release-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ description = {

dependencies = {
'lua >= 5.1',
'argparse',
'dkjson',
'luafilesystem',
}
Expand Down

0 comments on commit ea7d8e8

Please sign in to comment.