Skip to content

Commit

Permalink
Release v0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
IanLuites committed Oct 8, 2020
1 parent 59588c3 commit b49892f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ The following modules have extension:

## Changelog

### 2020-10-08 (v0.5.4)

- Small fix detecting compile environment.

### 2020-07-02 (v0.5.3)

- Compile warning fix.
Expand Down
12 changes: 6 additions & 6 deletions lib/common_x/application_x.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ defmodule ApplicationX do
@spec main_project :: Keyword.t()
def main_project, do: unquote(Macro.escape(main_project || []))

@test_tasks ~W(test coveralls coveralls.html coveralls.json)
_ = @test_tasks

env =
cond do
e = System.get_env("MIX_ENV") ->
Expand All @@ -121,10 +118,13 @@ defmodule ApplicationX do
|> Enum.map(&elem(&1, 1))
|> Enum.uniq()

preferred =
if main_project, do: Keyword.get(main_project, :preferred_cli_env, []), else: []

cond do
"run" in tasks -> :dev
Enum.any?(@test_tasks, &(&1 in tasks)) -> :test
:default -> :prod
env = Enum.find_value(tasks, &Mix.Task.preferred_cli_env/1) -> env
env = Enum.find_value(tasks, &Keyword.get(preferred, String.to_atom(&1))) -> env
:default -> :dev
end

:default ->
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule CommonX.MixProject do
def project do
[
app: :common_x,
version: "0.5.3",
version: "0.5.4",
description: "Extension of common Elixir modules.",
elixir: "~> 1.7",
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit b49892f

Please sign in to comment.