Commit bb33661ea9b1cec2a5d0c0c17379c2541da7c8ca

Thomas de Grivel 2022-04-08T09:19:46

comment out some IO.inspect

diff --git a/lib/kmxgit_web/controllers/repository_controller.ex b/lib/kmxgit_web/controllers/repository_controller.ex
index b83582a..cbfcd09 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -265,7 +265,7 @@ defmodule KmxgitWeb.RepositoryController do
           markdown_html = if ext && String.match?(ext, ~r/md/i) do
             Earmark.as_html!(content)
           end
-          IO.inspect(path: path, name: name, type: type)
+          #IO.inspect(path: path, name: name, type: type)
           %{git | content: content, content_html: content_html, content_type: type, filename: filename, line_numbers: line_numbers, markdown_html: markdown_html}
         {:error, error} -> %{git | status: error}
       end
@@ -371,7 +371,7 @@ defmodule KmxgitWeb.RepositoryController do
     git = git
     |> git_put_log1(repo, tree, path)
     |> git_put_commit(repo, conn, op, tree, path)
-    IO.inspect(git)
+    #IO.inspect(git)
     diff = case GitManager.diff(Repository.full_slug(repo), "#{git.log1.hash}~1", git.log1.hash) do
              {:ok, diff} -> diff
              _ -> nil
@@ -393,7 +393,7 @@ defmodule KmxgitWeb.RepositoryController do
       {:ok, diff} ->
         diff_html = Pygmentize.html(diff, "diff.patch")
         diff_line_numbers = line_numbers(diff)
-        IO.inspect(from: from, to: to, diff: diff, html: diff_html, line_numbers: diff_line_numbers)
+        #IO.inspect(from: from, to: to, diff: diff, html: diff_html, line_numbers: diff_line_numbers)
         conn
         |> assign_current_organisation(org)
         |> assign(:current_repository, repo)
@@ -411,7 +411,7 @@ defmodule KmxgitWeb.RepositoryController do
   end
   defp show_op(conn, :log, %{tree: tree, git: git, org: org, path: path, repo: repo}) do
     log = git_log(repo, tree, path)
-    IO.inspect([:log, tree: tree, git: git, path: path, log: log])
+    #IO.inspect([:log, tree: tree, git: git, path: path, log: log])
     conn
     |> assign(:tree, tree)
     |> assign(:tree_url, Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo, ["_log", tree] ++ (if path, do: String.split(path, "/"), else: []))))
diff --git a/lib/pygmentize.ex b/lib/pygmentize.ex
index caf60ac..b5ff789 100644
--- a/lib/pygmentize.ex
+++ b/lib/pygmentize.ex
@@ -6,7 +6,10 @@ defmodule Pygmentize do
   end
 
   def lexer(filename) do
-    {out, status} = System.cmd("pygmentize", ["-N", filename |> String.replace(~r/ /, "_")])
+    cmd = "pygmentize"
+    args = ["-N", filename |> String.replace(~r/ /, "_")]
+    IO.inspect({cmd, args})
+    {out, status} = System.cmd(cmd, args)
     case status do
       0 -> out |> String.trim()
       _ -> ""
@@ -28,15 +31,15 @@ defmodule Pygmentize do
       {^port, {:exit_status, 0}} ->
         acc |> Enum.reverse() |> Enum.join()
       {^port, {:exit_status, status}} ->
-        IO.inspect("pygmentize exited with status #{status}")
+        #IO.inspect("pygmentize exited with status #{status}")
         nil
       {^port, {:data, data}} ->
         html_port(content, port, [data | acc])
       {:DOWN, _, :port, ^port, reason} ->
-        IO.inspect({:down, reason})
+        #IO.inspect({:down, reason})
         acc |> Enum.reverse() |> Enum.join()
       x ->
-        IO.inspect(x)
+        #IO.inspect(x)
         html_port(content, port, acc)
     after 1000 ->
         result = acc |> Enum.reverse() |> Enum.join()