Skip to content

Commit

Permalink
Adjust nerves.artifact.get for Credo check
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcarstens committed Mar 30, 2023
1 parent 484a9ab commit 157dc99
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lib/mix/tasks/nerves.artifact.get.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ defmodule Mix.Tasks.Nerves.Artifact.Get do

%Nerves.Package{} = pkg ->
# Check to see if the package path is set in the environment
if Nerves.Artifact.env_var?(pkg) do
path = System.get_env(Nerves.Artifact.env_var(pkg))
Nerves.Utils.Shell.success(" Env #{app}")
Nerves.Utils.Shell.success(" #{path}")
else
cond do
Nerves.Artifact.env_var?(pkg) ->
path = System.get_env(Nerves.Artifact.env_var(pkg))
Nerves.Utils.Shell.success(" Env #{app}")
Nerves.Utils.Shell.success(" #{path}")

# Check the cache
case Artifact.Cache.get(pkg) do
nil ->
get_artifact(pkg)
cache_path = Artifact.Cache.get(pkg) ->
Nerves.Utils.Shell.success(" Found #{app} in cache")
Nerves.Utils.Shell.info(" #{cache_path}")

cache_path ->
Nerves.Utils.Shell.success(" Found #{app} in cache")
Nerves.Utils.Shell.info(" #{cache_path}")
end
true ->
get_artifact(pkg)
end

_ ->
Expand Down

0 comments on commit 157dc99

Please sign in to comment.