-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunners.lua
More file actions
78 lines (73 loc) · 1.62 KB
/
runners.lua
File metadata and controls
78 lines (73 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
local M = {}
M.runners = {
jigsaw = {
file = 'jigsaw',
path = vim.fn.getcwd() .. '/vendor/bin',
build = 'vendor/bin/jigsaw build',
serve = 'vendor/bin/jigsaw serve',
prod = 'vendor/bin/jigsaw build production',
},
hugo = {
file = 'hugo.toml',
path = vim.fn.getcwd(),
build = 'hugo',
serve = 'hugo server',
prod = 'hugo --gc --minify',
},
eleventy = {
file = { '.eleventy.js', 'eleventy.config.js', 'eleventy.config.cjs' },
path = vim.fn.getcwd(),
build = 'npm run build',
serve = 'npm run start',
prod = nil,
},
nextjs = {
file = 'next.config.js',
path = vim.fn.getcwd(),
build = 'npm run build',
serve = 'npm run dev',
prod = nil,
},
gatsby = {
file = 'gatsby-config.js',
path = vim.fn.getcwd(),
build = 'npm run build',
serve = 'npm run start',
prod = nil,
},
nuxtjs = {
file = 'nuxt.config.ts',
path = vim.fn.getcwd(),
build = 'npm run build',
serve = 'npm run dev',
prod = nil,
},
hexo = {
file = 'hexo',
path = vim.fn.getcwd() .. '/node_modules/.bin',
build = 'npx hexo generate',
serve = 'npx hexo server',
prod = nil,
},
astro = {
file = 'astro.config.mjs',
path = vim.fn.getcwd(),
build = 'npm run build',
serve = 'npm run start',
prod = nil,
},
}
M.find = function(runnerName)
if runnerName then
return runnerName, M.runners[runnerName]
end
for name, runner in pairs(M.runners) do
local r = vim.fs.find(runner.file, {
path = runner.path,
}, { type = 'file' })
if next(r) then
return name, runner
end
end
end
return M