@@ -29,8 +29,8 @@ defmodule Shoehorn.Release do
29
29
extra_deps = Access . get ( opts , :extra_dependencies , [ ] )
30
30
31
31
# Validate arguments
32
- Enum . each ( init_apps , & check_app / 1 )
33
- Enum . each ( last_apps , & check_app / 1 )
32
+ Enum . each ( init_apps , & check_app ( & 1 , release . applications ) )
33
+ Enum . each ( last_apps , & check_app ( & 1 , release . applications ) )
34
34
35
35
# Build dependency graph
36
36
sorted_apps =
@@ -178,9 +178,11 @@ defmodule Shoehorn.Release do
178
178
order_dependencies ( dep_graph , rest )
179
179
end
180
180
181
- defp check_app ( app ) when is_atom ( app ) , do: :ok
181
+ defp check_app ( app , applications ) when is_atom ( app ) do
182
+ applications [ app ] != nil or raise ReleaseError , "#{ app } is not a known OTP application"
183
+ end
182
184
183
- defp check_app ( { _ , _ , _ } = mfa ) do
185
+ defp check_app ( { _ , _ , _ } = mfa , _applications ) do
184
186
raise ReleaseError , """
185
187
#{ inspect ( mfa ) } is no longer supported in the Shoehorn `:init` option.
186
188
@@ -199,7 +201,7 @@ defmodule Shoehorn.Release do
199
201
"""
200
202
end
201
203
202
- defp check_app ( other ) do
204
+ defp check_app ( other , _applications ) do
203
205
raise ReleaseError , """
204
206
The Shoehorn `:init` option only supports atoms. #{ inspect ( other ) }
205
207
"""
0 commit comments