zachdaniel / git_ops

A tool for version and changelog management in Elixir via conventional commits.
MIT License
135 stars 24 forks source link

Improve error messages when not configured properly #2

Closed GregMefford closed 6 years ago

GregMefford commented 6 years ago

I added git_ops to my mix.exs but forgot to put in the config.exs stuff before I ran mix git_ops.release --initial for the first time. The resulting error message doesn't make it obvious what the problem was:

** (UndefinedFunctionError) function nil.project/0 is undefined. If you are using the dot syntax, such as map.field or module.function, make sure the left side of the dot is an atom or a map
    nil.project()
    lib/mix/tasks/git_ops.release.ex:62: Mix.Tasks.GitOps.Release.run/1
    (mix) lib/mix/task.ex:316: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
zachdaniel commented 6 years ago

You are very correct! I'll add a guard for it.

zachdaniel commented 6 years ago

I mean't to push this to a branch, but I was careless and pushed it to master. Either way, its a small and entirely harmless change so I think I will leave it :)