lua_module.cpp alterations for using os.execute with ONLY a url path to a lua script with sanitization to only allow downloading .lua script files to the scripts folder, in lua, the user cannot enter a specific path to download the file to as this is all handled in the lua_module.cpp.
Tested on Extras-Addon.lua, Extras-data.lua, json.lua and update.bat from my repository main (above). While the console tells me that update.bat gets downloaded, there is no actual trace of the file in the scripts folder at all, so the C++ implementation is doing its job to filter file extensions and only allow .lua files to pass through.
Which feature
lua_module.cpp alterations for using os.execute with ONLY a url path to a lua script with sanitization to only allow downloading .lua script files to the scripts folder, in lua, the user cannot enter a specific path to download the file to as this is all handled in the lua_module.cpp.
Lua Usage: os.execute(https://url.com/path/to/luascript.lua) Implementation: https://pastebin.com/b3zkfBNx
Reason
lua scripts should be able to have a "check for updates" button for easy updating, adding this option will allow for such things to be accomplished
Alternatively, you can do something like this with libcurl (Untested/Uninplemented Example): https://pastebin.com/BZk51yat
References: -- Button (Check for Updates) https://github.com/Deadlineem/Extras-Addon-for-YimMenu/blob/bf01e9991fdddde6ded32fbe2f4f113b2304b290/Extras-Addon.lua#L51
-- function getUpdates(file1, file2, file3) https://github.com/Deadlineem/Extras-Addon-for-YimMenu/blob/9d40cc519ec453b5c6e5e22505e976f167f04b82/Extras-data.lua#L4364
Example Video:
https://github.com/user-attachments/assets/3ce96ecd-598b-4fad-a603-c1e451bdc483
Additional context
Tested on Extras-Addon.lua, Extras-data.lua, json.lua and update.bat from my repository main (above). While the console tells me that update.bat gets downloaded, there is no actual trace of the file in the scripts folder at all, so the C++ implementation is doing its job to filter file extensions and only allow .lua files to pass through.