File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,8 @@ defmodule Mix.Tasks.App.Start do
162
162
{ :error , { :file . format_error ( :enoent ) , name } }
163
163
164
164
path ->
165
- case :file . consult ( path ) do
166
- { :ok , [ { :application , _ , properties } = application_data ] } ->
165
+ case consult_app_file_maybe_in_archive ( path ) do
166
+ { :ok , { :application , _ , properties } = application_data } ->
167
167
with :ok <- :application . load ( application_data ) do
168
168
if compile_env = validate_compile_env? && properties [ :compile_env ] do
169
169
# Unfortunately we can only check the current app here,
@@ -182,6 +182,19 @@ defmodule Mix.Tasks.App.Start do
182
182
end
183
183
end
184
184
185
+ defp consult_app_file_maybe_in_archive ( path ) do
186
+ # The path could be located in .ez archive
187
+ case :erl_prim_loader . get_file ( path ) do
188
+ { :ok , bin , _full_name } ->
189
+ with { :ok , tokens , _ } <- :erl_scan . string ( String . to_charlist ( bin ) ) do
190
+ :erl_parse . parse_term ( tokens )
191
+ end
192
+
193
+ :error ->
194
+ { :error , :enoent }
195
+ end
196
+ end
197
+
185
198
@ doc false
186
199
def type ( config , opts ) do
187
200
cond do
You can’t perform that action at this time.
0 commit comments