chore(go): fixing project creation
This commit is contained in:
1 parent
1c13c8cbe2
commit
421cf95bc6
2 files changed
+13
-5
No files matched your search
@@ -9,13 +9,18 @@ local M = {}
|
||||
M.attach = nil
|
||||
|
||||
M.create_project = function(root)
|
||||
local root_name = vim.fs.basename(root)
|
||||
local module_name = "com.DarthMooMancer." .. root_name
|
||||
local obj = vim
|
||||
.system({
|
||||
"go",
|
||||
"mod",
|
||||
"init",
|
||||
"com.DarthMooMancer." .. vim.fs.basename(root),
|
||||
})
|
||||
"sh",
|
||||
"-c",
|
||||
string.format(
|
||||
"go mod init %s && go build -o bin/%s main.go",
|
||||
module_name,
|
||||
root_name
|
||||
),
|
||||
}, { cwd = root })
|
||||
:wait()
|
||||
if obj.code ~= 0 then
|
||||
vim.notify(
|
||||
|
||||
@@ -51,6 +51,9 @@ target
|
||||
rustc-ice-*.txt
|
||||
#.idea/
|
||||
]=]),
|
||||
go = vim.trim([=[
|
||||
bin/
|
||||
]=]),
|
||||
}
|
||||
|
||||
local extra = (lang and lang_block[lang]) or ""
|
||||
|
||||
Reference in new issue
Block a user