diff --git a/lib/mix/lib/mix/tasks/escript.ex b/lib/mix/lib/mix/tasks/escript.ex index af83de3d05a..45cc2f0f277 100644 --- a/lib/mix/lib/mix/tasks/escript.ex +++ b/lib/mix/lib/mix/tasks/escript.ex @@ -14,6 +14,7 @@ defmodule Mix.Tasks.Escript do def run(_) do escripts_path = Mix.Local.path_for(:escript) + escripts_path |> list_dir() |> Enum.filter(fn filename -> executable?(Path.join(escripts_path, filename)) end) @@ -37,19 +38,19 @@ defmodule Mix.Tasks.Escript do {:win32, _} -> # on win32, the script itself is not executable, but the bat is File.exists?(path <> ".bat") and stat.type == :regular + _ -> - executable_bit = - stat.mode &&& (owner_exec_bit ||| group_exec_bit ||| other_exec_bit) + executable_bit = stat.mode &&& (owner_exec_bit ||| group_exec_bit ||| other_exec_bit) executable_bit != 0 and stat.type == :regular and Path.extname(path) != ".bat" end end defp print([]) do - Mix.shell.info "No escripts currently installed." + Mix.shell().info("No escripts currently installed.") end defp print(items) do - Enum.each items, fn item -> Mix.shell.info ["* ", item] end - Mix.shell.info "Escripts installed at: #{Mix.Local.path_for(:escript)}" + Enum.each(items, fn item -> Mix.shell().info(["* ", item]) end) + Mix.shell().info("Escripts installed at: #{Mix.Local.path_for(:escript)}") end end