@@ -28,6 +28,8 @@ defmodule Mix.Tasks.Deps.Compile do
2828 depending: 2 , format_dep: 1 , make?: 1 , mix?: 1 , rebar?: 1 ]
2929
3030 def run ( args ) do
31+ Mix.Project . get! # Require the project to be available
32+
3133 case OptionParser . parse ( args ) do
3234 { _ , [ ] } ->
3335 do_compile Enum . filter ( all , available? ( & 1 ) )
@@ -117,7 +119,7 @@ defmodule Mix.Tasks.Deps.Compile do
117119 shell . info "I can install a local copy which is just used by mix"
118120
119121 unless shell . yes? ( "Shall I install this local copy?" ) do
120- raise Mix.Error , message: "could not find rebar to compile " <>
122+ raise Mix.Error , message: "Could not find rebar to compile " <>
121123 "dependency #{ app } , please ensure rebar is available"
122124 end
123125
@@ -127,7 +129,7 @@ defmodule Mix.Tasks.Deps.Compile do
127129
128130 defp do_command ( app , command , extra // "" ) do
129131 if Mix . shell . cmd ( "#{ command } #{ extra } " ) != 0 do
130- raise Mix.Error , message: "could not compile dependency #{ app } , #{ command } command failed. " <>
132+ raise Mix.Error , message: "Could not compile dependency #{ app } , #{ command } command failed. " <>
131133 "If you want to recompile this dependency, please run: mix deps.compile #{ app } "
132134 end
133135 end
@@ -139,7 +141,7 @@ defmodule Mix.Tasks.Deps.Compile do
139141 defp do_compile ( app , command ) when is_binary ( command ) do
140142 Mix . shell . info ( "#{ app } : #{ command } " )
141143 if Mix . shell . cmd ( command ) != 0 do
142- raise Mix.Error , message: "could not compile dependency #{ app } , custom #{ command } command failed. " <>
144+ raise Mix.Error , message: "Could not compile dependency #{ app } , custom #{ command } command failed. " <>
143145 "If you want to recompile this dependency, please run: mix deps.compile #{ app } "
144146 end
145147 end
0 commit comments