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
162162 { :error , { :file . format_error ( :enoent ) , name } }
163163
164164 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 } ->
167167 with :ok <- :application . load ( application_data ) do
168168 if compile_env = validate_compile_env? && properties [ :compile_env ] do
169169 # Unfortunately we can only check the current app here,
@@ -182,6 +182,19 @@ defmodule Mix.Tasks.App.Start do
182182 end
183183 end
184184
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+
185198 @ doc false
186199 def type ( config , opts ) do
187200 cond do
You can’t perform that action at this time.
0 commit comments