Skip to content

ran formatter #6684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/mix/lib/mix/tasks/escript.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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