aboutsummaryrefslogtreecommitdiff
path: root/lua/tasks
diff options
context:
space:
mode:
authorundyamon <148129121+undyamon@users.noreply.github.com>2023-11-29 23:02:35 +0100
committerGitHub <noreply@github.com>2023-11-30 00:02:35 +0200
commitf2cbe8f4f5fbfc73ae8eb08521cd0080f536e626 (patch)
tree5ae64686975a62a800339a2682d9915ae43dbbb3 /lua/tasks
parentcbd99acd8af1d654625ffcaa155c4e0cc2b88638 (diff)
downloadneovim-tasks-f2cbe8f4f5fbfc73ae8eb08521cd0080f536e626.tar.gz
neovim-tasks-f2cbe8f4f5fbfc73ae8eb08521cd0080f536e626.zip
Add make module (#18)
Diffstat (limited to 'lua/tasks')
-rw-r--r--lua/tasks/module/make.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/lua/tasks/module/make.lua b/lua/tasks/module/make.lua
new file mode 100644
index 0000000..3d176c1
--- /dev/null
+++ b/lua/tasks/module/make.lua
@@ -0,0 +1,22 @@
1local Path = require('plenary.path')
2
3return {
4 params = { 'cmd' },
5 condition = function() return Path:new('Makefile'):exists() end,
6
7 -- This module supports dynamic tasks by using the `__index` metamethod.
8 -- By default, for any string `<task>`, calling `Task start make <task>`
9 -- will run `make <task>` (i.e., dynamic tasks are mapped to make targets).
10 -- This behavior can be customized by overriding the task 'args' parameters
11 -- in the `default_params` provided on setup.
12 tasks = setmetatable({}, {
13 __index = function(_, target)
14 return function(module_config, _)
15 return {
16 cmd = module_config.cmd,
17 args = module_config.args and module_config.args[target] or { target },
18 }
19 end
20 end,
21 }),
22}