This commit is contained in:
2025-08-10 20:52:03 -07:00
parent 0677fe39dd
commit ddec7ebe50
2 changed files with 14 additions and 2 deletions
+10 -2
View File
@@ -253,10 +253,18 @@ defmodule Systant.CommandExecutor do
env = build_command_environment()
Logger.info("Executing system command: #{inspect(final_command)} (timeout: #{timeout}ms)")
Logger.debug("Environment PATH: #{Map.get(env, "PATH")}")
Logger.debug("Environment USER: #{Map.get(env, "USER")}")
Logger.debug("Environment HOME: #{Map.get(env, "HOME")}")
Logger.debug("Environment XDG_RUNTIME_DIR: #{Map.get(env, "XDG_RUNTIME_DIR")}")
try do
case System.cmd(List.first(final_command), Enum.drop(final_command, 1),
stderr_to_stdout: true, timeout: timeout, env: env) do
task = Task.async(fn ->
System.cmd(List.first(final_command), Enum.drop(final_command, 1),
stderr_to_stdout: true, env: env)
end)
case Task.await(task, timeout) do
{output, 0} ->
execution_time = System.monotonic_time(:millisecond) - start_time
Logger.info("Command completed successfully in #{execution_time}ms")