From c72e739c34e57720b7736b0aded15363b549e7ce Mon Sep 17 00:00:00 2001 From: Eric Hunkler Date: Thu, 9 Jan 2025 15:22:18 -0700 Subject: [PATCH 1/2] Added debug log for install script output --- lib/vector/installer.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vector/installer.ex b/lib/vector/installer.ex index ef3f03f..e8d600d 100644 --- a/lib/vector/installer.ex +++ b/lib/vector/installer.ex @@ -63,7 +63,8 @@ defmodule Vector.Installer do install = String.replace(@install, "{path}", path) install = String.to_charlist(install) # credo:disable-for-next-line - :os.cmd(install) + debug_output = :os.cmd(install) + IO.puts(debug_output) validate!() end From 8cb3fc4257a45f72fe600db5dab7409b433ea66f Mon Sep 17 00:00:00 2001 From: Eric Hunkler Date: Wed, 15 Jan 2025 06:31:08 -0700 Subject: [PATCH 2/2] Only show debug info on error --- lib/vector/installer.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vector/installer.ex b/lib/vector/installer.ex index e8d600d..3493e55 100644 --- a/lib/vector/installer.ex +++ b/lib/vector/installer.ex @@ -63,18 +63,18 @@ defmodule Vector.Installer do install = String.replace(@install, "{path}", path) install = String.to_charlist(install) # credo:disable-for-next-line - debug_output = :os.cmd(install) - IO.puts(debug_output) - validate!() + debug_info = :os.cmd(install) + validate!(debug_info) end - defp validate! do + defp validate!(debug_info) do case Vector.version() do {:ok, version} -> Logger.debug("Vector #{version} installed.") :ok :error -> + IO.puts(debug_info) raise RuntimeError, "Vector binary failed to install." end end