From 72a7139ff75b4eccd6cc932cb48a88c198b072cf Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 9 Nov 2024 01:36:28 -0800 Subject: [PATCH] add lua support --- CHANGELOG.assets/logo.png | Bin 0 -> 9338 bytes CHANGELOG.md | 16 +++++++ src/internal/aww-run.cpp | 93 +++++++++++++++++++++++++------------- 3 files changed, 77 insertions(+), 32 deletions(-) create mode 100644 CHANGELOG.assets/logo.png diff --git a/CHANGELOG.assets/logo.png b/CHANGELOG.assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..4bdf7a9109a548c3b1fd786d68fc0452008120fc GIT binary patch literal 9338 zcmV-=B!%0FP){_9l1!30lbK{t zKd%=reKO~q=X=iip6B`QU-$%{;1hg&AtsxE$V1a1y#TB!5IY4-i6A9Z?}oOj!N;Z- z!qf|);|zFup|=AZUC`MwIkb-kT?Zk+>s9|kgDIROO&&A>ws`eGx;h5`mXZUXeHP+! z6*G9f(9;aBePcKSOkV+O9tN*lUCZ4K&4=KHe}%5L!N=-4cs(E^du#nLTOh3f@|VGs z0!YdMlLZ{zicwunaB@4;9fh8D#pGk-JYE6JR`qi87eL;nkUAI6ZHJeBH290K#KN3) z;B4o+(*!v{xe-?VXMw}%)#6}XjrtWR%OU*BVtOZbe1X?Pgr%f%%6GoQ~ zF|m+65Av5Q+2OsX;ZztHKsUks>*3OeAfZSxgJDSU*x~3iupu_gkwCuKWQk{5oXK24@p= zHI2Sf6<-ePo&wuc29|t(CNMY_Iwa2q3vgy9cm~ZKg$%Itc3Aae=&FM4--CCbgsMZ6 zO;u>{dZBh7csilzGf?sc$Si`!57m}66e(G7&95M7E(0%d=n4?RSePKa1bR-vxg-8R zMj->VS3~`Ku=~H^?4i*FnCOR;(9;2D_ra;xLE0g0Hk^GIIs)v;3vY$u|1(6&4-+&C zq|Jhg%}PyFm_!*s2(?7odnS*DiH7jmD|&l|Zv%;GaMKHrb!p`0mu`6TPT29=zQ1UZ zn`|`1Ccx5L;d9R@z5C+=DW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Nd;a|hn@57l7CSTH<5h#JuGYxe;Eh1j0^1T6-2~<2z4WT!@FbW|c#s*WeRl;l5e0cwNP&=f9geFu^rRYV3s)R)vXWoY7X^_1d3U5-b z=VO0`*B=Cr-&dx}Q2AHKHU`1)n3lLCSotl;EQOSrV6v(5t%;e#86dh}KAg7U=r~E0q}I6QMVJ^LI3~&07*qoM6N<$f-+vUF8}}l literal 0 HcmV?d00001 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc4668..a82c0ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,22 @@ +## 2024-11-09 + +Added LUA... via aww lib... via + +2024-11-09 [marovira/lua: The Lua Programming Language with Modern CMake](https://github.com/marovira/lua/tree/master) { github.com } + +![logo](CHANGELOG.assets/logo.png) + + + +Lua is published under the MIT license and can be viewed [here](https://github.com/marovira/lua/blob/master/LUA_LICENSE). For more information, please see their official website [here](https://www.lua.org/). + +This bundle is published under the BSD-3 license can be viewed [here](https://github.com/marovira/lua/blob/master/LICENSE) + + + ## 2024-11-07 Thu The next steps: diff --git a/src/internal/aww-run.cpp b/src/internal/aww-run.cpp index 54635a7..19a6659 100644 --- a/src/internal/aww-run.cpp +++ b/src/internal/aww-run.cpp @@ -8,6 +8,7 @@ #include "aww-common.hpp" #include "internal/aww-run.hpp" +#include // Include Lua header #include namespace fs = std::filesystem; @@ -25,7 +26,7 @@ int aww_run_main(const std::vector& cmdArgs) { if (noLogging) { spdlog::set_level(spdlog::level::off); } else { - spdlog::set_level(spdlog::level::info); // Set desired log level + spdlog::set_level(spdlog::level::info); } if (mutableCmdArgs.size() == 0) { @@ -33,21 +34,6 @@ int aww_run_main(const std::vector& cmdArgs) { return 1; } - aww::os::Proccess proc; - int exitCode = 0; - proc.onStdOut([](std::string line) { std::cout << line; }); - proc.onStdErr([](std::string line) { std::cerr << line; }); - - proc.onExit([&](int code) { - spdlog::warn("Exit code: {}", code); - exitCode = code; - }); - - // aww command is a shell script name without extension - // so that we can have "build.sh" and "build.bat" in the same folder - // and the correct one will be selected based on the OS - // Sample: - // aww run build std::string awwCommand = mutableCmdArgs[0]; fs::path maybeScriptPath; @@ -56,6 +42,37 @@ int aww_run_main(const std::vector& cmdArgs) { spdlog::warn("Found script: {}", maybeScriptPath.string()); std::string scriptExtension = maybeScriptPath.extension().string(); + // Check if the script is a Lua file + if (scriptExtension == ".lua" || scriptExtension == ".LUA") { + // Initialize Lua + lua_State* L = luaL_newstate(); + luaL_openlibs(L); + + // Measure time + auto start = std::chrono::high_resolution_clock::now(); + + // Execute Lua script file + if (luaL_dofile(L, maybeScriptPath.string().c_str()) != LUA_OK) { + std::cerr << "Error executing Lua script: " << lua_tostring(L, -1) << std::endl; + lua_pop(L, 1); + lua_close(L); + return 1; + } + + lua_close(L); + + // Calculate and log time taken + auto end = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast(end - start); + spdlog::warn("Lua script execution took {}ms", duration.count()); + + if (!noNotifications) { + aww::os::actions::show_notification("aww run", "Lua script finished successfully"); + } + return 0; + } + + // Existing functionality for other scripts bool isPowerShell = scriptExtension == ".ps1" || scriptExtension == ".PS1"; bool isBash = scriptExtension == ".sh" || scriptExtension == ".SH"; const aww::os::Platform platform = aww::os::OSPlatform; @@ -88,7 +105,7 @@ int aww_run_main(const std::vector& cmdArgs) { std::vector cmdArgsCopy = mutableCmdArgs; - // replace aww command with the full path to the script + // Replace aww command with the full path to the script if (scriptFound.is_ok()) { cmdArgsCopy[0] = awwCommand; } @@ -96,12 +113,19 @@ int aww_run_main(const std::vector& cmdArgs) { std::string cmd = aww::string::join(cmdArgsCopy, " "); spdlog::warn("Running command: {}", cmd); - // measure time - auto start = std::chrono::high_resolution_clock::now(); + aww::os::Proccess proc; + int exitCode = 0; + proc.onStdOut([](std::string line) { std::cout << line; }); + proc.onStdErr([](std::string line) { std::cerr << line; }); - proc.run(cmd); + proc.onExit([&](int code) { + spdlog::warn("Exit code: {}", code); + exitCode = code; + }); - // print time + // Measure time + auto start = std::chrono::high_resolution_clock::now(); + proc.run(cmd); auto end = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast(end - start); spdlog::warn("Command took {}ms", duration.count()); @@ -110,7 +134,6 @@ int aww_run_main(const std::vector& cmdArgs) { if (!noNotifications) { aww::os::actions::show_notification("aww run", "Failed to run command"); } - // describe what command failed and exitCode spdlog::error("Failed to run command: '{}'; ErrorCode: {}", cmd, exitCode); } else { if (!noNotifications) { @@ -135,29 +158,30 @@ aww::Result find_script_windows(const std::string& scriptName, fs::path& outScri const fs::path batCurrentDirPath = currentDir / (scriptName + ".bat"); const fs::path cmdCurrentDirPath = currentDir / (scriptName + ".cmd"); const fs::path ps1CurrentDirPath = currentDir / (scriptName + ".ps1"); + const fs::path luaCurrentDirPath = currentDir / (scriptName + ".lua"); const fs::path batAwwScriptsPath = awwScriptsDir / (scriptName + ".bat"); const fs::path cmdAwwScriptsPath = awwScriptsDir / (scriptName + ".cmd"); const fs::path ps1AwwScriptsPath = awwScriptsDir / (scriptName + ".ps1"); + const fs::path luaAwwScriptsPath = awwScriptsDir / (scriptName + ".lua"); const fs::path batAwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".bat"); const fs::path cmdAwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".cmd"); const fs::path ps1AwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".ps1"); + const fs::path luaAwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".lua"); const fs::path batAwwPath = awwDir / (scriptName + ".bat"); const fs::path cmdAwwPath = awwDir / (scriptName + ".cmd"); const fs::path ps1AwwPath = awwDir / (scriptName + ".ps1"); + const fs::path luaAwwPath = awwDir / (scriptName + ".lua"); - const size_t totalDirItems = 3 * 4; + const size_t totalDirItems = 4 * 4; std::array lookupPath = { - batCurrentDirPath, cmdCurrentDirPath, ps1CurrentDirPath, - - batAwwScriptsPath, cmdAwwScriptsPath, ps1AwwScriptsPath, - - batAwwDotScriptsPath, cmdAwwDotScriptsPath, ps1AwwDotScriptsPath, - - batAwwPath, cmdAwwPath, ps1AwwPath, + batCurrentDirPath, cmdCurrentDirPath, ps1CurrentDirPath, luaCurrentDirPath, + batAwwScriptsPath, cmdAwwScriptsPath, ps1AwwScriptsPath, luaAwwScriptsPath, + batAwwDotScriptsPath, cmdAwwDotScriptsPath, ps1AwwDotScriptsPath, luaAwwDotScriptsPath, + batAwwPath, cmdAwwPath, ps1AwwPath, luaAwwPath, }; for (const fs::path& path : lookupPath) { @@ -189,15 +213,20 @@ aww::Result find_script_linux(const std::string& scriptName, fs::path& outScript const fs::path ps1AwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".ps1"); const fs::path ps1AwwPath = awwDir / (scriptName + ".ps1"); + const fs::path luaCurrentDirPath = currentDir / (scriptName + ".lua"); + const fs::path luaAwwScriptsPath = awwScriptsDir / (scriptName + ".lua"); + const fs::path luaAwwDotScriptsPath = awwDotScriptsDir / (scriptName + ".lua"); + const fs::path luaAwwPath = awwDir / (scriptName + ".lua"); + const fs::path emptyCurrentDirPath = currentDir / scriptName; const fs::path emptyAwwScriptsPath = awwScriptsDir / scriptName; const fs::path emptyAwwDotScriptsPath = awwDotScriptsDir / scriptName; const fs::path emptyPath = awwDir / scriptName; - const std::array shLookupPath = { + const std::array shLookupPath = { shCurrentDirPath, shAwwScriptsPath, shAwwDotScriptsPath, shAwwPath, - ps1CurrentDirPath, ps1AwwScriptsPath, ps1AwwDotScriptsPath, ps1AwwPath, + luaCurrentDirPath, luaAwwScriptsPath, luaAwwDotScriptsPath, luaAwwPath, }; const std::array emptyLookupPath = {