diff --git a/lua/overseer/template/user/odin_build.lua b/lua/overseer/template/user/odin_build.lua new file mode 100644 index 0000000..4ae9496 --- /dev/null +++ b/lua/overseer/template/user/odin_build.lua @@ -0,0 +1,20 @@ +return { + name = "odin: build", + desc = "Build the Odin project (odin build .)", + condition = { + callback = function() + return vim.fn.glob("*.odin") ~= "" or vim.fn.expand("%:e") == "odin" + end, + }, + builder = function() + return { + cmd = { "odin" }, + args = { "build", "." }, + components = { + "default", + "on_output_quickfix", + { "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } }, + }, + } + end, +} diff --git a/lua/overseer/template/user/odin_run.lua b/lua/overseer/template/user/odin_run.lua new file mode 100644 index 0000000..4a1b012 --- /dev/null +++ b/lua/overseer/template/user/odin_run.lua @@ -0,0 +1,20 @@ +return { + name = "odin: run", + desc = "Build and run (odin run .)", + condition = { + callback = function() + return vim.fn.glob("*.odin") ~= "" or vim.fn.expand("%:e") == "odin" + end, + }, + builder = function() + return { + cmd = { "odin" }, + args = { "run", "." }, + components = { + "default", + "on_output_quickfix", + { "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } }, + }, + } + end, +} diff --git a/lua/overseer/template/user/odin_test.lua b/lua/overseer/template/user/odin_test.lua new file mode 100644 index 0000000..1b284cc --- /dev/null +++ b/lua/overseer/template/user/odin_test.lua @@ -0,0 +1,20 @@ +return { + name = "odin: test", + desc = "Run the tests (odin test .)", + condition = { + callback = function() + return vim.fn.glob("*.odin") ~= "" or vim.fn.expand("%:e") == "odin" + end, + }, + builder = function() + return { + cmd = { "odin" }, + args = { "test", "." }, + components = { + "default", + "on_output_quickfix", + { "on_complete_notify", statuses = { "SUCCESS", "FAILURE" } }, + }, + } + end, +}