Commit eb142cb2 authored by Marius Rackwitz's avatar Marius Rackwitz

Propagate version to prepare_command

parent cf3514ab
...@@ -59,9 +59,11 @@ module Pod ...@@ -59,9 +59,11 @@ module Pod
UI.section(' > Running prepare command', '', 1) do UI.section(' > Running prepare command', '', 1) do
Dir.chdir(path) do Dir.chdir(path) do
ENV.delete('CDPATH') ENV.delete('CDPATH')
ENV['COCOAPODS_VERSION'] = Pod::VERSION
prepare_command = spec.prepare_command.strip_heredoc.chomp prepare_command = spec.prepare_command.strip_heredoc.chomp
full_command = "\nset -e\n" + prepare_command full_command = "\nset -e\n" + prepare_command
bash!('-c', full_command) bash!('-c', full_command)
ENV.delete('COCOAPODS_VERSION')
end end
end end
end end
......
...@@ -58,6 +58,11 @@ module Pod ...@@ -58,6 +58,11 @@ module Pod
@spec.prepare_command = 'cd Classes;ls Banana.h' @spec.prepare_command = 'cd Classes;ls Banana.h'
lambda { @installer.install! }.should.not.raise lambda { @installer.install! }.should.not.raise
end end
it 'sets the $COCOAPODS_VERSION environment variable' do
@spec.prepare_command = "[ \"$COCOAPODS_VERSION\" == \"#{Pod::VERSION}\" ] || exit 1"
lambda { @installer.install! }.should.not.raise
end
end end
#--------------------------------------# #--------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment