Skip to content

Commit

Permalink
chore: Don't abort releases if an expected lib is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma authored Dec 28, 2021
1 parent af58983 commit 1da34cd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/google_apis/publisher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ defmodule GoogleApis.Publisher do

def should_publish?(directory) do
mix_exs = Path.join(directory, "mix.exs")
{{:module, mod, _, _}, _} = Code.eval_file(mix_exs)
project_info = apply(mod, :project, [])
if File.exists?(mix_exs) do
{{:module, mod, _, _}, _} = Code.eval_file(mix_exs)
project_info = apply(mod, :project, [])

app = Keyword.fetch!(project_info, :app)
version = Keyword.fetch!(project_info, :version)
app = Keyword.fetch!(project_info, :app)
version = Keyword.fetch!(project_info, :version)

Logger.info("Checking app: #{app} version: #{version}")
!version_exists?(app, version)
Logger.info("Checking app: #{app} version: #{version}")
!version_exists?(app, version)
else
Logger.info("Path #{mix_exs} does not exist")
false
end
end

def version_exists?(app, version) do
Expand Down

0 comments on commit 1da34cd

Please sign in to comment.