From a19b42cc097ad48dfcea16ffd565ad4f48ec90f9 Mon Sep 17 00:00:00 2001 From: Aotrix <9aotrix@protonmail.com> Date: Tue, 2 Jun 2026 23:59:17 +0200 Subject: Add custom command option: need to fix the createCommand function --- lua/aotrix/build.lua | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lua/aotrix/build.lua') diff --git a/lua/aotrix/build.lua b/lua/aotrix/build.lua index 3124e68..878bb73 100644 --- a/lua/aotrix/build.lua +++ b/lua/aotrix/build.lua @@ -14,19 +14,11 @@ function executeCommandInTerminal(command) end local COMMANDS = {} -COMMANDS.EditBatConfig = { - command = "cmake --build build", - description = "Build project" -} - -COMMANDS.SourceCurrentLuaFile = { - command = "pwd", - description = "Print current working directory" -} +local personalCommands = require("aotrix.personal_commands") COMMANDS.AddTempCommand = { - command = "echo 'Please implement me! A lua script which is executed maybe? Also remove global variables :p'", - description = "TODO IMPLEMENT ME" + command = function() personalCommands.createCommand(COMMANDS) end, + description = "Add temporary command" } function selectCommand(listOfCommands, callback) @@ -37,7 +29,7 @@ function selectCommand(listOfCommands, callback) end }, function(choice) if (choice ~= nil) then - CURRENT_COMMAND = listOfCommands[choice].command + CURRENT_COMMAND = listOfCommands[choice].command() callback() end end) -- cgit v1.2.3