This commit is contained in:
2025-08-29 00:18:21 +01:00
commit b750a9b71e
16 changed files with 1485 additions and 0 deletions

33
__injected_lib.lua Normal file
View File

@@ -0,0 +1,33 @@
-- Minimal luash helper functions
-- Local environment variable storage
local env_vars = {}
-- Environment variable access
function env_get(name)
-- Check local storage first, then system environment
return env_vars[name] or os.getenv(name) or ""
end
function env_set(name, value)
-- Store locally for this session
env_vars[name] = tostring(value)
-- Also try to set for subprocesses with proper quoting
local quoted_value = "'" .. tostring(value):gsub("'", "'\"'\"'") .. "'"
os.execute("export " .. name .. "=" .. quoted_value)
end
-- Shell command execution
function shell(command)
local handle = io.popen(command, "r")
if not handle then return "" end
local output = handle:read("*a")
handle:close()
-- Remove trailing newlines
return (output or ""):gsub("[\r\n]+$", "")
end
-- Interactive command execution (shows output directly)
function run(command)
return os.execute(command)
end