mirror of
https://github.com/kristoferssolo/runner.nvim.git
synced 2025-10-21 19:50:34 +00:00
25 lines
593 B
Lua
25 lines
593 B
Lua
local helpers = require('runner.handlers.helpers')
|
|
local utils = require('runner.handlers.utils')
|
|
|
|
return function(buffer)
|
|
utils.run_command(utils.script_path() .. 'get-scripts.sh', function(output)
|
|
local bins = {}
|
|
|
|
for _, line in pairs(output) do
|
|
for _, data in pairs(line) do
|
|
if vim.trim(data) ~= '' then
|
|
bins[#bins + 1] = data
|
|
end
|
|
end
|
|
end
|
|
|
|
local handlers = {}
|
|
|
|
for _, bin in pairs(bins) do
|
|
handlers['Run "' .. bin .. '"'] = helpers.shell_handler('npm run ' .. bin)
|
|
end
|
|
|
|
helpers.choice(handlers)(buffer)
|
|
end)
|
|
end
|